Skip to content

Make async test less flakey. - #1794

Merged
KevinRansom merged 2 commits into
dotnet:masterfrom
kurtschelfthout:async-test-1755
Nov 22, 2016
Merged

Make async test less flakey.#1794
KevinRansom merged 2 commits into
dotnet:masterfrom
kurtschelfthout:async-test-1755

Conversation

@kurtschelfthout

Copy link
Copy Markdown
Contributor

See #1755. Instead of a ref cell with a lock, we use a ManualResetEvent so that the sleep 100ms - which I assume is the reason for the flakiness, this is not proven - can be replaced with a generous timeout, while the test can still complete in reasonable time.

See #1755. Instead of a ref cell with a lock, we use a ManualResetEvent
so that the sleep 100ms - which I assume is the reason for the
flakiness, this is not proven - can be replaced with a generous timeout,
while the test can still complete in reasonable time.
@KevinRansom

Copy link
Copy Markdown
Contributor

@kurtschelfthout

Ironically .. the Appveyor failed due to the flakey test.

[00:53:06] 1) Failed : FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Control.AsyncModule.OnCancel.RaceBetweenCancellationHandlerAndDisposingHandlerRegistration
[00:53:06]   Expected: True
[00:53:06]   But was:  False
[00:53:06] at <StartupCode$FSharp-Core-Unittests>.$AsyncModule.test@286-22(Unit unitVar0) in C:\projects\visualfsharp-3dtit\src\fsharp\FSharp.Core.Unittests\FSharp.Core\Microsoft.FSharp.Control\AsyncModule.fs:line 296
[00:53:06] at FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Control.AsyncModule.OnCancel.RaceBetweenCancellationHandlerAndDisposingHandlerRegistration() in C:\projects\visualfsharp-3dtit\src\fsharp\FSharp.Core.Unittests\FSharp.Core\Microsoft.FSharp.Control\AsyncModule.fs:line 299
[00:53:06] 
[00:53:06] Run Settings
[00:53:06]     RuntimeFramework: V4.0
[00:53:06]     WorkDirectory: C:\projects\visualfsharp-3dtit\release\net40\bin
[00:53:06]     NumberOfTestWorkers: 2
[00:53:06] 
[00:53:06] Test Run Summary
[00:53:06]     Overall result: Failed
[00:53:06]    Tests run: 20850, Passed: 20849, Errors: 0, Failures: 1, Inconclusive: 0
[00:53:06]      Not run: 7, Invalid: 0, Ignored: 0, Explicit: 7, Skipped: 0
[00:53:06]   Start time: 2016-11-21 21:58:54Z
[00:53:06]     End time: 2016-11-21 22:09:09Z
[00:53:06]     Duration: 614.907 seconds

@kurtschelfthout

Copy link
Copy Markdown
Contributor Author

Another blow for the belief that humans can understand multi-threaded code.

Maybe the Cancel handler doesn't have time to register before the cancel happens. Let me see if I can fix that...

@KevinRansom

Copy link
Copy Markdown
Contributor

@kurtschelfthout
Thanks for this.

Kevin

@KevinRansom
KevinRansom merged commit bfd9bc6 into dotnet:master Nov 22, 2016
@KevinRansom KevinRansom mentioned this pull request Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants