Skip to content

Flaky: RpcTests Discovery_ReturnsFullTestCatalogue times out waiting for TCP connection on macOS CI #7230

Closed

Description

@thomhurst

What I saw

RunRpcTestsModule failed on modularpipeline (macos-latest) for PR #7143 (run https://github.com/thomhurst/TUnit/actions/runs/39486870308, job 118850497070):

failed Discovery_ReturnsFullTestCatalogue(net8·0) (1m 01s 071ms)
  TUnit.Engine.Exceptions.TestFailedException: [Test Failure] TimeoutException: Timeout waiting for TCP connection after 60s on port 49344
    at TUnit.RpcTests.TestHostSession.AcceptWithTimeoutAsync(...) in /_/tests/TUnit.RpcTests/TestHostSession.cs:103

The same commit passed on ubuntu and windows, and the PR does not touch the RPC/server-mode path. At the same time the macOS runner was running the native AOT publishes (PublishTestProjectAOTModule had been running for 20 minutes), so the spawned test host most likely did not start and connect within 60 seconds on a saturated runner.

Where

tests/TUnit.RpcTests/TestHostSession.cs, AcceptWithTimeoutAsync (fixed 60 s accept timeout).

Repro

Intermittent; seen on macOS CI under load. Not reproduced locally.

Expected

RPC tests should not fail because the host is slow to start on a busy runner. Options: a longer accept timeout on CI, or not running RPC tests in parallel with the AOT publishes (PR #7226 moves the AOT publishes into their own workflow, which may be enough on its own).

Activity

  1. added
    P2Medium: edge case, mode divergence, flaky test, or workaround exists
    on Oct 31, 2026
  2. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    Closing: the contention this flake came from is gone. #7226 (245c17c, merged 2026-10-20) moved the native AOT publishes into aot.yml, and dotnet.yml now runs the pipeline with ignore-categories: Aot. So the macOS modularpipeline job no longer runs PublishTestProjectAOTModule alongside RunRpcTestsModule. The two most recent failed dotnet.yml runs on main (41211887596 on macOS, 41311511530 on Windows) did not fail in the RPC tests. If Timeout waiting for TCP connection shows up again, reopen this issue and raise the accept timeout in tests/TUnit.RpcTests/TestHostSession.cs.

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

    P2Medium: edge case, mode divergence, flaky test, or workaround existsbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions