- Notifications
You must be signed in to change notification settings - Fork193
Closed
Description
This test has been failing for a while now -https://github.com/Qiskit/qiskit-ibm-runtime/actions/runs/5863436233/job/15896900505
It appears that when attempting to cancel a running job, callingjob.cancel() can return a 204 and raise no errors while the job is actually completed.
This snippet shows that the status ofjob isCANCELLED but retrieving the job and status again showsDONE, which is the correct status.
I'm guessing this is some sort of race condition where the job runs too quickly and if this is the case, it should be handled appropriately on the client side.
deftest_cancel_job_running(self,service):"""Test canceling a running job."""job=self._run_program(service,iterations=5)ifnotcancel_job_safe(job,self.log):returntime.sleep(10)# Wait a bit for DB to update.rjob=service.job(job.job_id())print("job==rjob is "+str(job==rjob))print("job.job_id() = "+str(job.job_id()))print("rjob.job_id() = "+str(rjob.job_id()))print("job.status() = "+str(job.status()))print("rjob.status()) = "+str(rjob.status()))self.assertEqual(job.status(),JobStatus.CANCELLED)