Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/agent_sdk/test_async_rollouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,17 @@ def test_gather_timeout_returns_partial():
reg = AsyncRolloutRegistry(max_workers=2)
try:
fast = reg.launch(lambda: "fast")
slow = reg.launch(lambda: time.sleep(10) or "slow")
done, pending = reg.gather([fast, slow], timeout=2)
assert fast in done
assert slow in pending
slow = reg.launch(lambda: time.sleep(60) or "slow")
# Wait for the fast child on its own first: forking a large test
# process can take seconds on a loaded node, and racing that
# against the short timeout below tested the node, not gather.
first, _ = reg.gather([fast], timeout=30)
assert first == [fast]
start = time.monotonic()
done, pending = reg.gather([fast, slow], timeout=0.5)
assert time.monotonic() - start < 10
assert done == [fast]
assert pending == [slow]
finally:
reg.shutdown()

Expand Down
Loading