Skip to content

RerunFailedTests pipelines intermittently take exactly 5s each, depending on which tests overlap #7632

Backlog

Description

@thomhurst

Summary

Under some test schedules, every pipeline that RerunFailedTests builds takes exactly 5.0s to finish instead of about 0.05s, so each test in the class takes 10.1s instead of 0.1s. About 31–35 tests are affected per run, which adds roughly 300s of test time and 60–120s of wall time to ModularPipelines.UnitTests. A fixed delay of exactly 5s in pipeline shutdown suggests a component that waits out a timeout instead of finishing.

Reproduction

The stall depends on which tests overlap, so it is intermittent:

  1. Make test/Shared/PipelineTestParallelLimit.cs an IAdaptiveParallelLimit (start 2, minimum 1, maximum 16), so the order and overlap of tests vary between runs.
  2. Run ModularPipelines.UnitTests (net11.0, Release) with TUNIT_ADAPTIVE_PARALLELISM=1.
  3. In the TRX, look for RerunFailedTests results with duration of about 00:00:10.1.

The stalls appeared in 6 of 11 runs with the adaptive limiter and in 0 of 6 runs with a fixed limit of 2 or 8. Running /*/*/RerunFailedTests/* alone never reproduced them. In the stalled runs, the tests overlapped ModuleTimeoutTests, StartupCancellationTests, ModuleCancellationGraceTests, CommandCancellationTests and ModuleHistoryTests.

Timing every builder.RunAsync in RerunFailedTests.RunAsync showed that each stalled test ran 2 pipelines of 5.04–5.06s each, back to back. Unstalled pipelines took well under 1s.

Expected and actual

Expected: each pipeline finishes in well under a second, whatever else is running.

Actual: each takes exactly 5s. Candidates with a 5s wait are the progress loop stop in src/ModularPipelines/Console/ProgressSession.cs:624 ("Progress display did not stop within 5 seconds") and _endHandlerTimeout in src/ModularPipelines/Engine/Executors/ExecutionOrchestrator.cs:55. Which one it is has not been confirmed. Capturing pipeline logs, or a dump during a stall, should settle it.

Environment

Windows 11, 20 logical CPUs, .NET 11.0.100, TUnit 1.90.0, main at ac76fd2.

Activity

  1. added
    bug
    on Nov 30, 2026
  2. added
    P2
    on Nov 30, 2026
  3. thomhurst commented on Dec 1, 2026

    @thomhurst
    OwnerAuthor

    CI evidence from the #7633 measurements (fixed limits, TUNIT_ADAPTIVE_PARALLELISM=1, TUnit 1.90.1, main at 8720656). Count of ModularPipelines.UnitTests processes in which all 36 RerunFailedTests cases took about 5s or 10s:

    PipelineTestParallelLimit Stalled processes Where
    2 0 of 9 none
    4 2 of 9 ubuntu only
    8 8 of 9 ubuntu, windows, macOS

    When a run stalled, the wall time with only stalled tests running was about 36-41s on windows, 42-48s on ubuntu at limit 8, 56-57s on macOS, and 82s on ubuntu at limit 4. So on CI the stall is not limited to the adaptive limiter: a fixed limit of 4 or more triggers it. Run IDs are in #7637.

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

    P2bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions