Skip to content

Skip CooperativeBlockingCanCreateThreadsFaster on Debug runtimes - #131834

Open
VSadov with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-cooperative-blocking-tests
Open

Skip CooperativeBlockingCanCreateThreadsFaster on Debug runtimes#131834
VSadov with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-cooperative-blocking-tests

Conversation

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

ThreadPoolTests.CooperativeBlockingCanCreateThreadsFaster is timing-sensitive and has been failing intermittently in CI. Every observed failure was in a Debug configuration, where the runtime is slow enough that the test's timing assumptions no longer hold — consistent with the historical investigation in #66765, which attributed failures to timeouts under concurrent load.

Changes

  • Added IsThreadingAndRemoteExecutorSupportedAndNotDebugRuntime to ThreadPoolTests, combining the existing condition with !PlatformDetection.IsDebugRuntime.
  • Switched the ConditionalFact on CooperativeBlockingCanCreateThreadsFaster to use it, so the test still runs in Release/Checked and is skipped on Debug.
// Timing-sensitive tests can be too flaky on a Debug runtime, which is much slower
public static bool IsThreadingAndRemoteExecutorSupportedAndNotDebugRuntime =>
    IsThreadingAndRemoteExecutorSupported && !PlatformDetection.IsDebugRuntime;

Test-only change; no product code is affected.

Copilot AI review requested due to automatic review settings August 4, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 4, 2026 22:07
Copilot AI changed the title [WIP] Fix ThreadPoolTests.CooperativeBlockingCanCreateThreadsFaster failure on Windows Skip CooperativeBlockingCanCreateThreadsFaster on Debug runtimes Aug 4, 2026
Copilot AI requested a review from VSadov August 4, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs:1506

  • PlatformDetection already provides SlowRuntimeTimeoutModifier specifically for tests that time out on Debug/Checked runtimes (see PlatformDetection.SlowRuntimeTimeoutModifier). Skipping the test entirely on Debug reduces coverage and may mask debug-only issues; consider instead scaling the WaitOne timeout by SlowRuntimeTimeoutModifier (or otherwise using that helper) so the test can still run on slower runtimes, unless there’s a strong reason to avoid lengthening Debug CI runs.
        // Timing-sensitive tests can be too flaky on a Debug runtime, which is much slower
        public static bool IsThreadingAndRemoteExecutorSupportedAndNotDebugRuntime =>
            IsThreadingAndRemoteExecutorSupported && !PlatformDetection.IsDebugRuntime;

@VSadov
VSadov requested a review from eduardo-vp August 4, 2026 22:12
@VSadov

VSadov commented Aug 4, 2026

Copy link
Copy Markdown
Member

@eduardo-vp - a test only change blocking a test on Debug corelib.

I do not think the PR will fail, since the failure is fairly rare. We can merge and see if it still reproduces.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @VSadov
See info in area-owners.md if you want to be subscribed.

@VSadov
VSadov marked this pull request as ready for review August 4, 2026 22:41
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThreadPoolTests.CooperativeBlockingCanCreateThreadsFaster failed on 10.0 on Windows

4 participants