We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5aa2cfe commit a269861Copy full SHA for a269861
1 file changed
packages/google-cloud-storage/tests/system/test_zonal.py
@@ -722,7 +722,15 @@ async def _run():
722
723
for i in range(num_chunks):
724
if i % 2 == 0:
725
- assert isinstance(results[i], asyncio.CancelledError)
+ # In fast environments, the task might complete before cancellation takes effect.
726
+ # We accept either Cancellation or successful completion to avoid flakiness.
727
+ if isinstance(results[i], asyncio.CancelledError):
728
+ pass
729
+ else:
730
+ assert results[i] is None
731
+ start = i * chunk_size
732
+ expected_data = object_data[start : start + chunk_size]
733
+ assert buffers[i].getvalue() == expected_data
734
else:
735
start = i * chunk_size
736
expected_data = object_data[start : start + chunk_size]
0 commit comments