File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/google-cloud-storage/tests/system Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -722,7 +722,15 @@ async def _run():
722722
723723 for i in range (num_chunks ):
724724 if i % 2 == 0 :
725- assert isinstance (results [i ], asyncio .CancelledError )
725+ # 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
726734 else :
727735 start = i * chunk_size
728736 expected_data = object_data [start : start + chunk_size ]
You can’t perform that action at this time.
0 commit comments