Compare commits
1 Commits
main
...
fix/flaky-
| Author | SHA1 | Date | |
|---|---|---|---|
| 143c08ea12 |
@@ -601,9 +601,21 @@ class TestCoordinatorIntegration:
|
||||
coordinator = Coordinator(queue_manager=queue_manager, poll_interval=0.02)
|
||||
|
||||
task = asyncio.create_task(coordinator.start())
|
||||
await asyncio.sleep(0.5) # Allow time for processing
|
||||
await coordinator.stop()
|
||||
|
||||
# Poll for completion with timeout instead of fixed sleep
|
||||
deadline = asyncio.get_event_loop().time() + 5.0 # 5 second timeout
|
||||
while asyncio.get_event_loop().time() < deadline:
|
||||
all_completed = True
|
||||
for i in range(157, 162):
|
||||
item = queue_manager.get_item(i)
|
||||
if item is None or item.status != QueueItemStatus.COMPLETED:
|
||||
all_completed = False
|
||||
break
|
||||
if all_completed:
|
||||
break
|
||||
await asyncio.sleep(0.05)
|
||||
|
||||
await coordinator.stop()
|
||||
task.cancel()
|
||||
try:
|
||||
await task
|
||||
|
||||
Reference in New Issue
Block a user