Skip to content

tests: run-engine and session tests read the box's real load and time out on a busy machine #1525

Open

Description

@AbirAbbas

What happened

Several run-engine and session tests start real run seats, which pass through the machine gate (task.max_load, default 1.5 per core). On a busy box they wait machine busy · load per core at or above task.max_load 1.5, then time out. They are green in CI and alone, and red when another suite is running beside them. CLAUDE.md treats that as a bug, not a known flake.

Seen on 2026-09-25 on an 8-core box at load 11–24:

  • internal/session TestUnderOneModelEveryRunSeatRidesTheConversationsModel/the_launch_model: timed out waiting for the run to end on dev@691ade547 at load 12, and 11 s alone. Added in task room, landing and --one-model: real file names, one note sentence, every seat on one model, no build caches #1517.
  • internal/run TestSupervisorLaunchesEveryReadyLeafAtOnceWithNoSlotBound and TestAnUnboundedRunEndedEarlyStillDrainsEveryWorker: fail even alone at load about 11.
  • Also timing out only under load: TestPlandbCliWorkerOwnDone, TestARunCorrectedPastItsRoundLimitStopsWithoutMergingOrSayingDone, TestBeltRunCarriesMachineGateAndShowsItsHold, TestPlandbCliLoopThroughBash, TestACarriedOverDesignRaisesItsCardAndSavesOnYes, TestTheDelegationDoorsCrossFromTheEnginesProfile (session); TestHostedTasksToolStopEndsTheRunAndReportsWhatHappened (remote).

Replication

Deterministic:

stress-ng --cpu $(( $(nproc) * 2 )) --timeout 600s &   # or any load above 1.5 per core
go test -count=1 -run 'TestUnderOneModelEveryRunSeatRidesTheConversationsModel' ./internal/session
go test -count=1 -run 'TestSupervisorLaunchesEveryReadyLeafAtOnceWithNoSlotBound' ./internal/run

Both fail today. Without the load, both pass.

The fix

A test that is not about the machine gate runs with the gate out of its way, through its fixture profile or an injected load reader, never the box's real /proc/loadavg. A test that IS about the gate injects the load it needs.

Acceptance

  • Unit: each named test passes with stress-ng holding the box above 1.5 per core.
  • A law test, or a single fixture helper, so that a new run-engine test cannot read the real load by accident.

Activity

  1. added
    bugSomething the code does that it should not
    area:testsThe suite itself — flakes, harnesses, laws, CI reds
    on Sep 26, 2026
  2. santoshkumarradha commented on Sep 28, 2026

    @santoshkumarradha
    Member

    Confirmed another instance of this issue in the three cmd/codeaf run-engine model-seat tests at 635723f03. beltRunEnv disables the machine load/memory gates in the fixture profile, but each test replaced the profile JSON with model-only rows, restoring task.max_load=1.5. The original combined run reached its 60-second deadline without starting any provider call.

    A deterministic assertion immediately after that setup reproduces all three failures (got "1.5", want 0) without synthetic host load. The bounded test-only correction applies model rows through the existing settings API, preserving the fixture limits and asserting both remain zero. Original model/exit/output assertions and timeouts are unchanged.

    The three complete model-seat workflows and TestDoRunHonoursProfileMachineFloor each passed three repetitions (18.241 seconds total). The latter retains coverage that an explicitly configured real machine gate still blocks. This correction is pending aggregate integration; it does not claim the other tests listed in this issue are resolved.

  3. AbirAbbas commented on Sep 29, 2026

    @AbirAbbas
    CollaboratorAuthor

    More evidence from 2026-09-29 (dev 461a43fb6, an 8-core WSL laptop with nothing else running): make test-report PKGS=./internal/session on an untouched checkout failed TestARefutedNodesRepairRoundRunsOnTheCarefulModel, TestAuditVerifiesAChangeThatPassesItsTest, TestRefutedWorkIsRepairedInPlaceAndLandsWhenItHolds; three make pr-ready runs of a branch that only changes one prompt paragraph failed a different set each time — task N never finished after 30–130 s (TestADoneLandingWithARewrittenReportStillDeliversItsAnswer, TestAnOrdinaryQuestionLeavesTheAssignmentExactlyWhereItWas, TestTickingAnItemMovesTheRowToTheNextItem, TestThresholdsStopANodeThatIsNotGettingAnywhere, TestAStalledCheckIsAbandonedAndTheSecondCallAnswers, …). The package's own eight shards drive the load average to ~8, and the shards run 244–291 s against ~160 s when quieter. Every named test passes alone, repeatedly. CI's touched packages passed the same branch (#1682). So on a laptop the session suite is not a usable local merge gate today, even with no other suite beside it.

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

    area:testsThe suite itself — flakes, harnesses, laws, CI redsbugSomething the code does that it should not

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions