OrleansContrib / OrleansTestKit

Unit Test Toolkit for Microsoft Orleans
http://dotnet.github.io/orleans
MIT License
76 stars 42 forks source link

TimerExtensions.FireAllTimers fails if any timer subscriptions have been disposed #132

Closed fergusbown closed 1 year ago

fergusbown commented 1 year ago

Presumably either the below should ignore disposed timers, or TestTimer.FireAsync() should just be a no-op if the instance is disposed?

    public async Task FireAllAsync()
    {
        foreach (var testTimer in new List<TestTimer>(_timers))
        {
            await testTimer.FireAsync().ConfigureAwait(false);
        }
    }

I'm happy to make a PR obviously - not sure if there is a preference for one approach or the other?

seniorquico commented 1 year ago

Fixed in #129. Thanks, @spingee!