Skip to content

Tests: two runtime tests no longer race the daemon - #767

Merged
lydakis merged 2 commits into
mainfrom
claude/wave2-parked-stats
Nov 7, 2026
Merged

lydakis merged 2 commits into
mainfrom
claude/wave2-parked-stats

Conversation

@lydakis

@lydakis lydakis commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

What

Two runtime tests depended on timing that CI sometimes loses. This PR changes only the tests.

A parked turn's slot

When a turn parks, the daemon commits turn_waiting first and releases the turn's active slot a moment later, when the turn's task ends. A stats read in between still counts the turn in active_turns. That made test_answered's test_a_slow_answer_parks_the_turn_and_its_error_is_the_result fail once in CI on #716 with (1, 1) != (0, 1).

That test, and the approvals test that reads the same stats, now poll until active_turns drops to 0, with a 5 s deadline. test_delivery already does this.

Releasing the slot inside the park would change the daemon's admission order, so it would need its own discussion. The current order is safe: a parked turn holds no slot by the time its task returns.

A steered-away command's finish

In test_steers_beyond_the_context_budget_stay_queued_and_run_as_their_own_turns, the first steer moves the running sleep .4 to the background. When the sleep finished before the third steer's turn reached the model, the finish notice joined that turn's input, and the echo model answered the notice instead of the steer. That happened on this PR's first CI run.

The command is now sleep 5, which outlasts all three turns. The test still finishes in about 2.6 s, because none of the turns waits for the command.

Performance

None. This changes tests only.

Tests

  • All three tests pass locally.
  • tests.test_delivery passes in full.

🤖 Generated with Claude Code

turn_waiting commits as the turn parks, and its active slot is let go
when its task ends just after, so a stats read right after the event can
still count it active. The two tests that read active_turns there now
wait for it, as test_delivery already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGE9yc1n2RvseSR8ahH
@lydakis lydakis self-assigned this Nov 7, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T01:33:12.389702Z 050d8bc New commits
🔒 Security Review ✅ Completed 2026-11-07T01:17:52.254091Z c31220f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The first steer moves the running command to the background. When it
finished before the third steer's turn reached the model, its finish
joined that turn's input and the echo answered it instead of the steer.
The command now runs past all three turns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGE9yc1n2RvseSR8ahH
@lydakis lydakis changed the title Tests: wait for a parked turn's slot before reading its stats Tests: two runtime tests no longer race the daemon Nov 7, 2026
@lydakis
lydakis merged commit 8c8c578 into main Nov 7, 2026
4 checks passed
@lydakis
lydakis deleted the claude/wave2-parked-stats branch November 7, 2026 01:47
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.

2 participants