test: Make the mocked run status sequence independent of poll timing - #1028
test: Make the mocked run status sequence independent of poll timing#1028vdusek wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1028 +/- ##
=======================================
Coverage 94.95% 94.95%
=======================================
Files 58 58
Lines 5436 5436
=======================================
Hits 5162 5162
Misses 274 274
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing - the flake this targeted was in the client, not the mock. In the CI run cited above, The mock's timing coupling is real but latent, and the trade here isn't worth it: holding the run open until the plain sequence is walked means a stalled watcher hangs ✍️ Drafted by Claude Code |
test_actor_call_redirect_logs_to_default_logger_syncand its three siblings flake in CI, dropping('Status: RUNNING, Message: Initial message', 20)(example).StatusResponseGeneratoradvanced the status every 5 requests, counted across every caller of the run endpoint — the two setup GETs, the watcher's 1-per-second polls, andwait_for_finish's 4-per-second polling loop.wait_for_finishburned the "Initial message" window in roughly half a second, so the watcher's first poll had a ~0.5s margin to land inside it.Plain requests and
waitForFinishrequests are now answered separately: plain requests walk the status sequence, andwaitForFinishreports the run finished only once they have walked all of it. The first status covers three plain requests, which iscall's two setup GETs plus the watcher's own first poll in any order. With nothing watching there are no plain requests and the run reads as finished immediately, socall(logger=None)still returns at once.Verified by injecting a delay before the watcher's first poll: on master the tests fail from 0.6s upward; with this change the two
call()-based tests pass at 0.6s, 2s, 5s and 10s. (test_redirect_status_message_syncstill fails past ~5s, but that is bounded by its own 1ssleep, not by the mock.)✍️ Drafted by Claude Code