Skip to content

tests: internal/session has load-dependent reds on dev — a different test each full run #959

Description

@santoshkumarradha

What is true

A full go test ./internal/session/ -count=1 on dev alone fails, and fails a different test each run. Every one of them passes in isolation.

Three runs on the Spark this evening, all at d726ff259 or a branch off it:

run what was red
branch, session beside tui3 TestTheRunningModelIsNeverSentTheCheckpoint, TestASplitIsNeverDroppedByTheRunningModelsDeclaration, TestACoordinationSketchStartsNothingAndRealPartsStillConvert, TestOnlyASpentBudgetSealsOverWorkThatIsMoving
branch, session alone TestTheCeilingsQuickNodeHasTheToolsShape, TestAnsweringLetAforgeDecideTwiceStandsRatherThanRefusing, TestATurnThatCannotBeCheckedBeforeTheWallIsNotMoved
dev, session alone TestASplitIsNeverDroppedByTheRunningModelsDeclaration

The third row is the one that matters: a clean dev worktree, nothing else in that go test invocation, still red. None of these names is in .github/known-red.txt.

An earlier run of the same branch reported ok internal/session 173.896s, so it is not reliably red either.

Why this is filed rather than re-run

CLAUDE.md is explicit: "A internal/session test that fails only when other suites are running beside it is now a bug report, not a known shape: reproduce it, do not rerun it in isolation and move on." I reproduced it, and the reproduction is above.

The failure shape, where it is legible

TestOnlyASpentBudgetSealsOverWorkThatIsMoving sets config.Budget = Budget{Wall: time.Nanosecond} and then expects the notice to say the running work was left where it was. Under load it got:

stopping here · the 1ns this was given are up

and no stopLeftItMovingTail. A one-nanosecond wall is already expired before the work can be observed as moving, so whether the test passes depends on whether the scheduler let the node start first. That is a race between the fixture's deadline and the goroutine it is meant to catch mid-flight, not a property of the code under test.

I have not checked whether the other six share that shape. They may not; what they share is being timing-sensitive enough to flip under load.

Replication

# on the Spark, a clean worktree at origin/dev
go test ./internal/session/ -count=1 -timeout 20m
# expect a red; expect a different name next time

Acceptance

go test ./internal/session/ -count=1 green on dev ten times running on a loaded box, with no test skipped and no name added to .github/known-red.txt — the ledger only shrinks. A fixture that needs a deadline gets one it can actually lose to, or a synchronisation point instead of a duration.

Why it is urgent now

Several aforge lanes are landing work through this package. A package that is red at random makes every lane's proof unreadable: you cannot tell a lane that broke something from a lane that ran on the wrong evening. I hit exactly that confusion tonight on #951 and had to run dev separately to clear the lane.

🤖 Generated with Claude Code


Drafted with CodeAF · reviewed and owned by the author

Activity

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 notsev:papercutA wording, a hint, a small wrongness that costs a moment

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions