Skip to content

mac CI: ServeConnectionTests is timing-flaky under load (two different tests in two days) #1333

Description

@ozymandiashh

Two unrelated PRs, two different tests in the same suite, both pure timing failures on macos-latest, both branches untouched ServeConnection:

date PR run test failure
2026-09-11 #1290 (menubar second row) 34626755506 a request queued during cancelled hydration completes on the same child (ServeConnectionTests.swift:263) expected events [..., "second-replied"], got the array without the last event
2026-09-12 #1289 (zh-Hans localization) 34725149445 cancelling a hung request returns promptly (ServeConnectionTests.swift:182, :185) error → ServeUnavailable() where CancellationError was expected, and elapsed → 1.08 s against a 500 ms budget

Both re-runs of the same head went green, and neither branch touches mac/Sources/CodeBurnMenubar/Data/ServeConnection*. The second failure is the informative one: a 500 ms wall-clock budget on a shared runner is not a property of the code, and the cancellation arriving as ServeUnavailable suggests the child was torn down by the timeout path before the cancellation propagated, i.e. the two races the suite is supposed to distinguish collapse under load.

Suggested fix, for whoever owns ServeConnection: drive these tests with an injected clock / continuation instead of real sleeps, or at least widen the wall-clock assertions to something a busy runner can meet (the neighbouring cli-status-menubar vitest flake at the 30 s boundary is the same class, see #1216's history). Filing so the next red run on this suite is recognised as this rather than chased.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions