Repository navigation
fix(test): make the flaky e2e tests hermetic and condition-driven - #711
Merged
Merged
Conversation
The agents e2e queued its child behind the real machine guard (load, spawn interval, shared registry); it now runs in its own home with the guard opened. The doctor window test read an unrelated delegation headroom warning as a window warning; it now reads the window line. Temp dirs no longer reuse pid-named names, and delegate test waits are bounded at 60 s instead of 5 s.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Fixes the flaky local tests in #702:
agents::parent_spawns_child_polls_until_settled,compaction_e2e::doctor_warns_non_fatally_about_a_missing_window, the pid-named temp dir inconfig_apply, and hardens the waits ofdelegate::tests::an_independent_participant_is_a_consult_child_settled_with_its_report.Why
Reproduced each on a clean
developunder CPU load before changing anything.parent_spawns_child_polls_until_settledfailed 12 of 15 runs under load. The test ran against the real$HOME, sodelegatewent through the real machine guard: the machine-wide registry and 2 s spawn interval (any other tole on the machine queued the child) and the real load limit (queued: load 7.07 per CPU > 1.50). A queuedagent_startresult carries noagentid, so the content-driven mock replied withagent_startagain until the loop guard stopped the run (exit 7).doctor_warns_non_fatally_about_a_missing_windowasserted that the wholedoctorreport has no!line. The report also carries the delegation headroom (! load 2.06 per CPU (max 1.50), memory, disk), so any busy or nearly full machine failed it: 72 of 72 runs in parallel under load. Nothing to do with the window.config_apply(and the other temp dirs touched here) were named after the pid plus a counter and never removed, so a reused pid found a stale trusted project or home from an earlier run.Changes
tests/agents.rs: each run gets its ownCODECORA_HOME(outside the workspace) with a user config that opens the machine guard to its bounds. New tests:a_run_never_touches_the_machine_home(fails without the fix: a decoyHOMEis populated with.codecora) anda_run_opens_the_machine_guard.tests/compaction_e2e.rs: the window verdict is read from thecontext windowline, and the test now also runs with a guard that always warns (min_free_disk_mb = 16 TiB) so the unrelated warning is certain. Temp dir names carry a clock stamp.tests/config_apply.rs: temp dir names carry a clock stamp.src/delegate_tests.rs: condition waits bounded at 60 s (were 5 s / 200 x 25 ms), the non-blocking checks at 30 s, and the shared data dir is unique per run.Testing
agents12/15 failed under load,doctor_warns...72/72 failed in parallel under load.agents0/48 failed with 12 parallel runs under the same load (load average above 15),doctor_warns...0/72,config_apply0/16.cargo fmt,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace(twice),cargo test -p tole-core --no-default-features: green.session_effort_e2e(flaky test: session_effort_e2e::a_rejecting_provider_still_answers_without_the_parameter (session lock still held by the test process) #646) andwire_size_missions(0 failures in 36 parallel runs each under load); the delegate test (0 failures in 40 runs at 64 threads, and 12 runs pinned to one CPU). No fixed ports, no sleeps and no shared names were found in the first two; the cause of the one-off failures is unknown.Refs #702 (the not-reproduced tests stay open there).