Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb9b3fda

Browse files
sim-eng-iikt474
andauthored
Investigate/fixtest_cancel_running_job() intest_job.py (#1022)
* update `test_cancel_job_running` in `test_job.py` to wait_for_status()* update `cancel()` in `runtime_job.py` to include `ex.status_code == 204`* release notes fix_test_cancel_job_running-771511870d82d4e4.yaml* substitute line 248 with `ex.status_code in (409, 204)` in `runtime_job.py` for semplicity* revert to `ex.status == 409` `in cancel()` function in `runtime_job.py`* update release notes for `fix_test_cancel_job_running-771511870d82d4e4.yaml`* fix `test_cancel_job_running.py` in `test_job.py`* release notes: `fix_test_cancel_job_running-771511870d82d4e4.yaml`---------Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
1 parent22654cb commitb9b3fda

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fixes:
2+
-|
3+
Fixes a race condition in the function `test_cancel_running_job()` in `test_job.py`
4+
where job cancellation could not be performed.
5+
Refer to #1019 <https://github.com/Qiskit/qiskit-ibm-runtime/issues/1019>_ for
6+
more details.

‎test/integration/test_job.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ def test_cancel_job_running(self, service):
161161
service,
162162
circuits=[ReferenceCircuits.bell()]*10,
163163
)
164-
ifnotcancel_job_safe(job,self.log):
165-
return
166-
time.sleep(10)# Wait a bit for DB to update.
167164
rjob=service.job(job.job_id())
165+
ifnotcancel_job_safe(rjob,self.log):
166+
return
167+
time.sleep(10)
168168
self.assertEqual(rjob.status(),JobStatus.CANCELLED)
169169

170170
@run_integration_test

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp