Skip to content

flaky tests: agents::parent_spawns_child_polls_until_settled and compaction_e2e::doctor_warns_non_fatally_about_a_missing_window fail on a clean develop locally #702

Closed

Description

@ajianaz

Closed 2026-11-17. One real race was found and fixed (#884): the stand-in child of delegation::delegate::tests wrote env > file in place, a CI runner's environment is over 4 KiB so it is written in several chunks, and the test read a prefix (CI failure on #880, job no-mcp profile, assertion at delegate_tests.rs ~991). fake_reporter and the discussion reviewer_bin now write the record to a temporary name and rename it into place, and the lib tests remove their shared-delegate-data-* directory at exit. The other tests of this issue were NOT reproduced under taskset -c 0 with busy loops and --test-threads 16 to 32 (agents::parent_spawns_child_polls_until_settled and a_run_never_touches_the_machine_home 0/100, compaction_e2e 0/100, config_apply 0/100: its temp dirs no longer use reused pids, session_effort_e2e and wire_size_missions read and left alone). One harness note: the agents tests open the delegation load guard to its bound of 64 load per CPU, so a child is queued only above that, which a CI runner does not reach. Reopen with a failing CI run or a recorded stress failure if one of these tests flakes again. The TUI pty tests were fixed separately in #881 (#877).

Seen by several agents while working on #683, #681, #684 and #588 (PRs #697 to #701). CI Test passed every time; locally, on a clean develop checkout, both fail (one consistently under load on the shared build machine).

Tests

Why it matters

Local gates are the contract agents run before pushing. Tests that fail on a clean develop make it impossible to tell a real regression from the environment, and they hide real failures.

Fix

  • Reproduce each (CPU-limited, --test-threads high, disk near full) and find the cause: fixed sleeps or timeouts, ports, shared temp names, wall-clock assumptions, environment such as a missing HOME or window size.
  • Replace sleeps with condition waits, per-test unique temp dirs (not pid-named), bounded and generous timeouts, no network or fixed ports.
  • Each fix keeps a test that fails without it (for example a deliberately slowed mock).
  • Do not skip, ignore or quarantine a test to get green.

Activity

  1. added
    bug
    on Nov 14, 2026
  2. ajianaz commented on Nov 15, 2026

    @ajianaz
    ContributorAuthor

    Status 2026-11-15: the sleep-based waits of the tests named here were converted to the shared wait_until helper in #823 (merged), the nightly one-CPU workflow exists (#824) and is green on develop (run 43689185320), and #826 fixed a leak that only showed under starvation. No failure of these two tests was seen in the stress runs of #823, but one run is not proof: keeping this issue open; close it if the nightly stays green for a week.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions