Skip to content

Flaky tests under load: session replay/walk/feather-fall and the GM-line threading test #296

Closed

Description

@pjerra

Several tests fail now and then under load and pass on a re-run. Seen on 2026-10-22 during full go test ./... runs (workers run the suite under flock /tmp/ta-test.lock nice -n 10, often with other load on the machine):

  • internal/session TestReplayEqualsLiveEvents: "17 decoded events, 18 live" (twice).
  • internal/session TestWalkPathKeepsToTheGround: timed out once.
  • internal/session TestFeatherFallMidFlight: failed once.
  • internal/session TestWalkPathCountsAlongThePathWhenRootedAfterACorner: "worldtest: no MSG_MOVE_SET_FACING within 2s".
  • cmd/turtle-agent TestGMLineRunsOnTheConfirmedSelectionWhenSelectionAndChatAreOnSeparateThreads: failed once.

Each passed alone and on a re-run. They make a red suite ambiguous for every branch and cost a re-run per worker.

Wanted: find the shared cause (fixed waits such as 2 s deadlines, races between the replay decoder and the live event channel, wall-clock use in tests) and make the tests deterministic, without weakening what they check.

Activity

  1. added a commit that references this issue on Oct 23, 2026
  2. pjerra commented on Oct 23, 2026

    @pjerra
    OwnerAuthor

    The four session test flakes are fixed in #300 (tests and harness only): the cause was the WSL2 host stepping its wall clock back about 2.2 s every ~30 s. Results under -race: each of the four went from 2-3 failures in 50 runs to 0 in 200. Still open: the GM-line threading test caught a real selection race (a GM line could run on a stale selection); its fix is on branch fix/gm-selection-echo, in review.

  3. pjerra commented on Oct 23, 2026

    @pjerra
    OwnerAuthor

    Fixed: the flaky session tests in #300, and the GM selection race the threading test caught in #301 (a GM line now runs only on a selection the server confirmed by an echo of the agent's own send, never during the agent's own combat; otherwise it is refused with nothing sent).

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions