File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -76,18 +76,23 @@ async def op(
7676 for i in range (num_nexus_operations )
7777 ]
7878
79- # Poll
80- for _ in range (50 ): # 5 seconds max
81- if len (ids ) >= expected_num_executed :
79+ # Allow 3s for expected operations to start
80+ deadline = asyncio .get_event_loop ().time () + 3.0
81+ while len (ids ) < expected_num_executed :
82+ if asyncio .get_event_loop ().time () > deadline :
8283 break
83- await asyncio .sleep (0.1 )
84+ await asyncio .sleep (0.05 )
8485
8586 # No more should arrive
86- await asyncio .sleep (0.2 )
87- assert len (ids ) == expected_num_executed
88- assert len (set (ids )) == len (ids )
87+ await asyncio .sleep (0.1 )
8988
9089 event .set ()
90+
91+ assert (
92+ len (ids ) == expected_num_executed
93+ ), f"Expected { expected_num_executed } operations, got { len (ids )} "
94+ assert len (set (ids )) == len (ids ), "Duplicate operation IDs detected"
95+
9196 for task in tasks :
9297 if not task .done ():
9398 task .cancel ()
You can’t perform that action at this time.
0 commit comments