Skip to content

Commit e1d51cd

Browse files
authored
Fix test_submit_cancel_future_expects_engine_cancellation_rpc_call for Python 3.13.12 (#7879)
Problem: `test_submit_cancel_future_expects_engine_cancellation_rpc_call` started failing in Python 3.13.12 whilst passing in 3.13.11. It seems the tested future is canceled before starting and so it cannot change the tested values. Solution: Add a short sleep time so the future thread gets to run.
1 parent bd4c30b commit e1d51cd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cirq-google/cirq_google/engine/stream_manager_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def test_submit_cancel_future_expects_engine_cancellation_rpc_call(self, client_
319319
async def test():
320320
async with duet.timeout_scope(5):
321321
result_future = manager.submit(REQUEST_PROJECT_NAME, REQUEST_PROGRAM, REQUEST_JOB0)
322+
await duet.sleep(0.001) # Let result_future start before it is canceled
322323
result_future.cancel()
323324
await duet.sleep(1) # Let cancellation complete asynchronously
324325
manager.stop()

0 commit comments

Comments
 (0)