Skip to content

test(cli,headless): stop gating ordering assertions on fixed wall-clock budgets - #2304

Merged
Astro-Han merged 2 commits into
apache:mainfrom
Benjamin-eecs:fix/2221-waitfor-deadline
Aug 6, 2026
Merged

Astro-Han merged 2 commits into
apache:mainfrom
Benjamin-eecs:fix/2221-waitfor-deadline

Conversation

@Benjamin-eecs

Copy link
Copy Markdown
Contributor

Summary

Closes #2221

Three pieces, matching the issue and its follow-up comment:

  • The shared TUI waitFor keeps its 250 ms budget locally but takes 5 s under CI (MAKA_TEST_WAIT_BUDGET_MS overrides both). A passing wait returns the moment the predicate turns true, so the budget only bounds how long a failing assertion takes to report; the fixed 250 ms bought nothing on green runs and lost scheduling races on loaded runners. It also takes an optional description now, and the expiry message names the budget and what was being waited on instead of false !== true.
  • The harbor-cell test that raced normal completion against settleAfterMs: 1_000 now expresses the ordering it always meant. runHarborCell takes a settleSignal promise that arms the same settlement the timer would, and the test resolves it from the backend at the point where the terminal claim is provably taken: the post-terminal drain pulls the next generator value only after the previous event was processed, so resuming after yield complete is the barrier. The 1100 ms sleep against a 1000 ms timer is gone.
  • Sweep for the same shape, per the follow-up comment: two more fixed-deadline local waiters in the cli tests (runtime-bootstrap, cli-goal-continuation) now share the scaled budget as a floor-raise. The two remaining settleAfterMs uses in harbor-cell assert the direction where the deadline should win; load only widens their margin, and both already carry guards, so they are left alone.

Verification

  • packages/cli suite passes with the new helper signature across all 373 call sites.
  • packages/headless harbor-cell suite passes three consecutive runs with the rewritten test.
  • The original failure shapes cannot recur by construction: the CI budget is twenty times the observed 262 ms overshoot, and the harbor-cell ordering no longer involves a clock.

@Benjamin-eecs
Benjamin-eecs marked this pull request as ready for review August 6, 2026 02:49
Copilot AI lite review requested due to automatic review settings August 6, 2026 02:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix — the settleSignal barrier is much stronger than the wall-clock race it replaces, and the scaled wait budget policy (local floor + CI 5s) matches how these waits actually behave. LGTM.

@Astro-Han
Astro-Han merged commit bb5f3a6 into apache:main Aug 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cli): waitFor's fixed 250 ms wall-clock deadline makes 373 TUI assertions flaky under CI load

3 participants