Skip to content

Flaky on CI: the session-mark invitation test races a 40 ms timer against a 1 s poll budget [spec 14 §2.7] #269

Description

@wine-fall

What it is

test/director-taste.test.ts > invitations (spec 14 §2.7/§5.10) > adds /feature-request at the session mark, from a one-shot timer times out on
loaded CI runners with Error: timed out waiting for the mark. Three
occurrences, on three different branches, including main itself:

Run Branch When
35089835842 main 2026-09-16 11:21
35174354885 zachg-0916--pick-prefetch-switching (#265) 2026-09-17 02:25
35179139751 zachg-0917--pick-queue-depth2 (#266) 2026-09-17 03:42

Each time a plain rerun of the same commit passed. The main occurrence
pre-dates both PRs, so this is the test, not a change either of them made.

Cause (verified by reading, not by reproducing): the test arms
featureInviteAfterMs: 40 — a 40 ms one-shot timer — and then waits on
until(), whose budget is 200 × 5 ms ≈ 1 s (test/fakes.ts:412-419). There is
no slack between "the timer is late" and "the test fails": one scheduling stall
on a shared runner is enough. The two other suites seen timing out in the same
loaded runs (package.test.ts, tui-wave-image.test.ts, both green in
isolation) point the same way — runner contention, not logic.

Not yet investigated

  • Whether featureMark.unref() (src/director/director.ts, run()) contributes:
    an unref'd timer is still serviced while the loop has other handles, but
    nobody has checked its behaviour under a saturated event loop.
  • Whether any other until()-based director test is close enough to the same
    budget to be the next one to go.

Spec

specs/spec14/14-listening-taste.md §2.7 / §5.10 — the invitation the test
covers. The behaviour is not in question here; only the test's timing margin.

Done when

The test no longer depends on a 40 ms timer landing inside a 1 s poll budget —
either the mark is given real slack or the wait is driven by the event rather
than by wall-clock — and the suite runs green across 20 consecutive CI runs with
no rerun. A change that cannot be shown to have removed the margin does not
close this.

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

    bugSomething isn't workingengEngineering work: a measured defect or a performance target

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions