Skip to content

test(cli): keep the delegate queue test children alive across the second delegate - #628

Merged
ajianaz merged 1 commit into
developfrom
test/delegate-queue-deflake
Nov 12, 2026
Merged

ajianaz merged 1 commit into
developfrom
test/delegate-queue-deflake

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What

A test-only fix for a flaky test on develop. The two delegate queue tests now start children that live 1 s instead of exiting at once. No production code changes.

Why

CI on #626 failed in delegate::tests::the_machine_guard_queues_and_a_poll_starts_the_queued_child (queued was null instead of true), and every PR can hit it until the fix is on develop.

Both queue tests (that one and a_new_delegate_never_starts_ahead_of_an_older_queued_one) run with max_live_processes = 1 and start the first child with a stand-in binary that exits immediately. On a slow runner the first child is gone before the second delegate. An exited, unreaped child counts as gone (#623), so recovery frees its slot and the second child starts instead of queueing.

The same change is in #627, which is still in review; when #627 merges, git sees the same lines.

Changes

  • crates/tole-cli/src/delegate_tests.rs: both queue tests build their host with host(&root, 1, …), so each stand-in child sleeps 1 s and the first is still running when the second is delegated. 2 lines.

Testing

  • Reproduced the race: with a 300 ms pause inserted between the first and the second delegate (what a slow runner does), the old short-lived children failed 10 runs out of 10. With the 1 s children and the same pause, 0 out of 10 failed.
  • Without the pause: 30 runs of the two tests failed 0 times before the change (the flake does not show on this machine) and 0 times after.
  • Commands (private CARGO_TARGET_DIR, CARGO_INCREMENTAL=0):
    • cargo fmt --all --check: clean
    • cargo clippy --workspace --all-targets -- -D warnings: clean
    • cargo test --workspace --no-fail-fast: 1509 passed, 0 failed
    • cargo test -p tole-core --no-default-features: 511 passed, 0 failed
    • cora review --no-llm --staged: no issues found

…ond delegate

The two queue tests started their first child with a stand-in that
exits at once. On a slow runner it was gone (a zombie, which counts as
dead) before the second delegate, so recovery freed the slot and the
second child started instead of queueing. Their children now live 1 s,
so the first is still running when the second is delegated. Test-only
change.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit ca2bed2 into develop Nov 12, 2026
19 of 20 checks passed
@ajianaz
ajianaz deleted the test/delegate-queue-deflake branch November 20, 2026 08:40
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