Async tests with cancellation are flaky
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
The following tests are flaky:
https://github.com/dotnet/fsharp/blob/402e1d3f2451bfe1795839b1684dc9965eedc4c7/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs#L276-L339
The signed build can fail with stack traces that look like:
```
The active test run was aborted. Reason: Test host process crashed : go
Unhandled exception. System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.FSharp.Control.AsyncPrimitives.Start@893-1.Invoke(ExceptionDispatchInfo edi)
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 104
at Microsoft.FSharp.Control.AsyncPrimitives.continuation@951-2(AsyncActivation`1 ctxt, Boolean useCcontForTaskCancellation, Task completedTask) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 952
at Microsoft.FSharp.Control.AsyncPrimitives.taskContinueWithUnit(Task task, AsyncActivation`1 ctxt, Boolean useCcontForTaskCancellation) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 966
at .$Async.AwaitTask@1708-2.Invoke(AsyncActivation`1 ctxt) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 1708
at Microsoft.FSharp.Control.AsyncPrimitives.ProtectedCode[T](AsyncActivation`1 ctxt, FSharpFunc`2 userCode) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 453
at .$Async.OnCancel@1690-5.Invoke(AsyncActivation`1 ctxt) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 1690
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 104
at .$Async.-ctor@155-1.Invoke(Object o) in /Users/runner/work/1/s/src/fsharp/FSharp.Core/async.fs:line 157
at System.Threading.ThreadPoolWorkQueue.Dispatch()
```
Contributor guide
Assessment
This issue has not been assessed yet.