test: Make the mocked run status sequence independent of poll timing - #1028
Draft
vdusek wants to merge 1 commit into
Draft
test: Make the mocked run status sequence independent of poll timing#1028vdusek wants to merge 1 commit into
vdusek 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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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