Skip to content

Experiment tests with 1s Trial timeouts fail under heavy local load on macOS #1472

Closed

Description

@JacobStephens2

This was generated by AI during triage.

What happens

Three experiments tests give their Trials --timeout 1. They pass in CI and when run alone. Under heavy local load on macOS, the Trial's 1-second deadline can run out before the work the test is checking happens, and they fail:

  • timed_out_trials_keep_partial_usage_and_exportable_session_ancestry (tests/experiments.rs)
  • code_graders::check_timeout_cleans_descendants_before_packet_and_remains_failed (tests/experiments/code_graders.rs:129)
  • model_graders::model_grader_timeout_keeps_trace_and_resume_reuses_trials (tests/experiments/model_graders.rs:96)

Reproduction (macOS 26, 18 cores, after #1457)

  • cargo test --test experiments, which uses 18 threads by default: 81 passed, 3 failed. These three tests are the ones that failed.
  • Twelve concurrent copies of timed_out_trials_keep_partial_usage_and_exportable_session_ancestry: 4 of 12 failed, with input_tokens Null instead of 11.
  • cargo test --test experiments -- --test-threads=3, about a macOS CI runner's core count: 84 passed. Four concurrent copies of that test, over three rounds: 12 of 12 passed.

Context

#1455 / #1457 removed the large fixed cost: on macOS, the first exec of each freshly copied evals/builds/<commit>/thirdshift took about 0.85s, and macOS ran those first execs one at a time. What remains is the ordinary cost of preparing a Trial before the Harness starts, which happens inside the same deadline (src/evals/experiment/execution.rs, output_until(..., Instant::now() + self.timeout, ...)). Under contention, that preparation alone can use up 1s. Before #1457, 7 of 12 concurrent copies failed even with --timeout 10, which shows how contention-sensitive the setup is.

Open question for triage

CI isn't affected, so this is about how reliably a full local cargo test passes. Options:

  1. Leave it alone. Local full runs should use nextest or a lower --test-threads, and the docs could say so.
  2. Raise these tests' timeouts to a few seconds. Each test then takes longer, because the fake agents sleep past the deadline.
  3. Have these tests wait for evidence that the Trial or grader really started, for example a marker file written by the fake agent, rather than relying on a short wall-clock budget. That needs the timeout to start from something the test controls.

Activity

  1. added
    bug
    needs-triage
    on Oct 27, 2026
  2. JacobStephens2 commented on Oct 27, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Decision: option 1. #1473 documents running with fewer test threads in docs/testing.md. Tests and code are unchanged.

  3. added
    ready-for-human
    and removed
    needs-triage
    on Oct 27, 2026
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

    bugready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions