Skip to content

Flaky: TestLiveEventTurnRestartForwarded can hang the server package for the full 10m test timeout #137

Description

@andybons

Observed on CI run https://github.com/majorcontext/harness/actions/runs/32424396070/job/96603193119 (PR #135, commit 44a20a7 — which touches only modelmeta lookup tables; the test is byte-identical to main, landed in #116, and uses provider test which modelmeta ignores).

The timeout dump shows TestLiveEventTurnRestartForwarded running 9m59s. The test publishes exactly one live event immediately after openSSE and then blocks in waitFornextEvent, which ranges the item channel with no deadline (server/server_test.go:367-388) — so if that single event is lost to a subscribe/publish race, the test consumes the package's entire 10m alarm instead of failing fast. 20 consecutive local -race runs pass in ~2s; the CI runner also had leaked goal-retry goroutines from earlier tests (waitGoalRetryableBackoff attempt 8, goalBlockingStream.Next 5m) adding scheduler pressure.

Two independent fixes worth making:

  1. Bound nextEvent with a deadline (e.g. 30s) so any lost-event bug fails one test in seconds instead of hanging the package.
  2. Make the publish/subscribe ordering in this test deterministic — either have openSSE synchronize on server-side subscriber registration, or re-publish until received.

Also worth a look: the leaked goal goroutines in the dump suggest some goal tests don't cancel their retry loops on cleanup.

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