Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PeriodicTimer_ActiveOperations_TimerRooted test (#68805)
There are two problems with this test 1. `WaitForNextTickAsync` may return a synchronously completed task, in which case it does not root the timer, causing our first `WaitForTimerToBeCollected` to fail because the timer was collected. This problem is easily reproduced by adding a small sleep after constructing the `PeriodicTimer` in `Create`, and I believe it is the cause of #59542. 2. There is no guarantee that the timer is not still rooted after the wait finishes because the returned `ValueTask<bool>` may be keeping it alive (although, it seems unlikely Roslyn will extend the lifetime across the await like this). Fixed by wrapping in another NoInlining method. Fix #59542
- Loading branch information