Flaky test: Microsoft.Extensions.Time.Testing.Test.TimerTests.CreateTimer_WhenDisposed_RemovesWaiterFromQueue
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 894
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
### Description
This test appears to be flaky:
`Microsoft.Extensions.Time.Testing.Test.TimerTests.CreateTimer_WhenDisposed_RemovesWaiterFromQueue`
The test logic mentions timers so it's likely a timing thing.
Example build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1083349&view=ms.vss-test-web.build-test-results-tab&runId=29475172&resultId=111586&paneView=debug
Test failure output:
```
Assert.Equal() Failure: Values differ
Expected: 1
Actual: 0
```
Stack trace:
```
at Microsoft.Extensions.Time.Testing.Test.TimerTests.CreateTimer_WhenDisposed_RemovesWaiterFromQueue() in D:\a\_work\1\s\test\Libraries\Microsoft.Extensions.TimeProvider.Testing.Tests\TimerTests.cs:line 208
```
### Reproduction Steps
Retry the test in CI several times.
### Expected behavior
The test should be deterministic.
### Actual behavior
It is flaky.
### Regression?
_No response_
### Known Workarounds
_No response_
### Configuration
_No response_
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.