Skip to content

Flaky test: WaitsFor_Propagates_OCE_When_Predicate_Observes_Supplied_Token exceeds 500ms budget on macOS CI #7169

Closed

Description

@thomhurst

What happened

WaitsFor_Propagates_OCE_When_Predicate_Observes_Supplied_Token failed on the modularpipeline (macos-latest) job for PR #7142, which does not touch WaitsFor:

AssertionException: Expected to be less than 00:00:00.5000000
but received 00:00:00.5703934

Run: https://github.com/thomhurst/TUnit/actions/runs/39337383745 (job 118350153289)

Where

tests/TUnit.Assertions.Tests/WaitsForAssertionTests.cs:489

The test cancels the token after 50ms with a 30s WaitsFor timeout, then asserts the elapsed time is under 500ms. On a loaded macOS runner the run took ~570ms.

Expected

The test should prove cancellation short-circuits the 30s timeout without depending on tight wall-clock timing. A budget such as 5s still proves the point (it is far below the 30s timeout) while tolerating slow CI runners.

Reproduce

Intermittent; seen on shared macOS GitHub runners under parallel load.

Activity

  1. thomhurst commented on Oct 20, 2026

    @thomhurst
    OwnerAuthor

    A second test in the same class failed the same way on macOS CI, on PR #7150: https://github.com/thomhurst/TUnit/actions/runs/39342684370/job/118367770528.

    WaitsForAssertionTests.WaitsFor_PropagatesExternalCancellation_Before_Internal_Timeout (net8.0, arm64) cancels after 100 ms and asserts the elapsed time is under 1 s. It measured 00:00:01.1912052. That is the same pattern as this issue: a wall-clock budget that a loaded macOS runner can exceed. A fix for this issue should cover both tests (tests/TUnit.Assertions.Tests/WaitsForAssertionTests.cs:429).

  2. added a commit that references this issue on Oct 20, 2026
    4e90643
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 working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions