Skip to content

Fix flaky test: cancellationpropagatestotask#19569

Merged
abonie merged 1 commit intomainfrom
fix/flaky-cancellationpropagatestotask
Apr 15, 2026
Merged

Fix flaky test: cancellationpropagatestotask#19569
abonie merged 1 commit intomainfrom
fix/flaky-cancellationpropagatestotask

Conversation

@T-Gro
Copy link
Copy Markdown
Member

@T-Gro T-Gro commented Apr 10, 2026

Automated fix for flaky test.

Test: FSharp.Core.UnitTests.Control.AsyncType.CancellationPropagatesToTask

Add synchronization to ensure the async computation has actually started
running on the thread pool before cancelling the default token. Without
this, under heavy CI load the thread pool may not schedule the async
within the 1-second wait window, causing the task to never transition
to Canceled state before the timeout.

This mirrors the pattern already used by the CancellationPropagatesToGroup
test which uses a ManualResetEvent for the same purpose.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

✅ No release notes required

@T-Gro T-Gro requested a review from abonie April 13, 2026 09:53
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Apr 14, 2026
@abonie abonie merged commit ce2a17a into main Apr 15, 2026
55 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Apr 15, 2026
Copilot AI pushed a commit that referenced this pull request Apr 15, 2026
Add synchronization to ensure the async computation has actually started
running on the thread pool before cancelling the default token. Without
this, under heavy CI load the thread pool may not schedule the async
within the 1-second wait window, causing the task to never transition
to Canceled state before the timeout.

This mirrors the pattern already used by the CancellationPropagatesToGroup
test which uses a ManualResetEvent for the same purpose.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants