Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PeriodicTimer_ActiveOperations_TimerRooted test #68805

Merged
merged 3 commits into from
May 3, 2022

Commits on May 3, 2022

  1. Fix PeriodicTimer_ActiveOperations_TimerRooted test

    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 dotnet#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. This is unlikely since Roslyn should not extend the
       lifetime of the `ValueTask<bool>` like this across the await, but I
       have introduced another method just to be safe.
    
    Fix dotnet#59542
    jakobbotsch committed May 3, 2022
    Configuration menu
    Copy the full SHA
    e0f62cc View commit details
    Browse the repository at this point in the history
  2. Update src/libraries/System.Runtime/tests/System/Threading/PeriodicTi…

    …merTests.cs
    
    Co-authored-by: Stephen Toub <stoub@microsoft.com>
    jakobbotsch and stephentoub committed May 3, 2022
    Configuration menu
    Copy the full SHA
    de3c1d8 View commit details
    Browse the repository at this point in the history
  3. Fix typo

    jakobbotsch committed May 3, 2022
    Configuration menu
    Copy the full SHA
    981eb63 View commit details
    Browse the repository at this point in the history