Repository navigation
[TH-9515] test: prove the flush-window bound without timing the runner - #286
Merged
khushalsonawat merged 3 commits intoNov 12, 2026
Merged
khushalsonawat merged 3 commits into
khushalsonawat merged 3 commits into
Conversation
The test gave the run a 0.2-second flush window and asserted it ended in under 1.5 seconds. Both numbers measured the runner, not the bound: on a slow CI runner the terminal's own delivery missed the tiny window and the run exited 4. The window is now 2.0 seconds, and emit_skipped_receipts waits on an event that is never set, so the run can end only because the window's wait_for cuts it off. An outer 30-second guard turns a broken bound into a failure rather than a hang. The other assertions are kept. TH-9515 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
The change review (Lane Q, round 1) showed the 30 s guard was the only time check left, so a cut-off 10 s or 25 s late still passed. The stalled receipts call now records when it starts and when the window's cancel reaches it, re-raises the cancel, and the test asserts that gap is under twice the window. Both late plants now fail at that assertion. The never-reached receipt push and its assertion are dropped. TH-9515 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
cdileep23
requested changes
Nov 11, 2026
…me it took Dileep found the test still timed the cut, with enough slack that a cut 1.8 s late on a 2.0 s window passed, and that it couldn't tell the remaining window from the full one. The test now records the timeout passed to wait_for around the stalled emit_skipped_receipts and asserts 0 < timeout < window: the code passes the remaining window, which is always under the full one. The outer 30 s guard stays, so a hang still fails. The +1.8 plant and timeout=None both fail it. TH-9515 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
Member
Author
|
Fix-only check of 5e35bf8 (the first review's fix, never checked until now) and 62b316b (Dileep's P2), one reviewer: clear, with 0 High, 0 Medium and 3 Low.
|
Member
Author
|
CI at 62b316b: SDK smoke's clean-install failed one test, and it comes from the base, not this PR.
|
cdileep23
approved these changes
Nov 12, 2026
khushalsonawat
merged commit Nov 12, 2026
02334dc
into
feat/TH-8804-source-subfolder
2 of 3 checks passed
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.
Description
test_post_terminal_wire_block_is_bounded_by_the_remaining_flush_windowfailed once on #273's CI.run_jobreturned 4,EXIT_TERMINAL_UNDELIVERED, because the terminal's own delivery didn't fit in the test's 0.2 s flush window on a slow runner. The test also asserted the whole run took under 1.5 s, which locally used about 1.3 s of it. Both numbers measured how fast the runner was, not whether the bound holds.This is a test-only change. The flush-window code in
hosted_entrypoint.pyis unchanged.Type of Change
Changes
emit_skipped_receiptsis replaced by a call that waits on an event that is never set, so it can only end when the window'swait_forcancels it. The stall stands in for the receipt push.62b316b4, after Dileep's review). A spy onwait_forrecords the timeout passed with the stalled call, and the test asserts0 < timeout < window. The code passes the remaining window, which is always under the full one, so a late cut and a full-window timeout both fail.asyncio.wait_forof 30 s, so a broken bound fails with a clear message instead of hanging the suite.canceledterminal, the first scenariopassedand the pool closed are all still asserted.The test now always takes about 2 s.
Testing
tests/harness/test_hosted_entrypoint.py:livekit; it isn't installed in that venv, and they fail the same way on the base.hosted_entrypoint.py, each run on this test and then restored:wait_foraroundemit_skipped_receiptsremovedtimeout=NoneKnown limits
run_jobreturns 4 again. A planted 2.5 s delay there fails the test; a planted 1.5 s delay passes. Locally those steps take under 0.07 s, so the 2.0 s window is about 30 times what's needed. The source readstime.monotonic()rather thandeps.clock, so a test-only change can't control that clock.cpulimitor beside a busy loop, to keep the laptop cool. The reviewer measured the same margin directly with the two delay plants above.5e35bf80. A fix-only check of5e35bf80and62b316b4, one reviewer: clear, 0 Medium (results in the comments).Related Issues
Refs: TH-9515