You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the Timeout.InfiniteTimeSpan when it's used with the RegisterTimer doesn't work as expected. It's should only executed once, but it appears not to be.
Here is a dummy RegisterTimer
public Task DummyTimer() { RegisterTimer( o => SimpleMethod(), "dummy", TimeSpan.FromSeconds(5), Timeout.InfiniteTimeSpan) };
Here is the problem, the method SimpleMethod() is called two time, but should be only called once.
Here is the sample of the implementation of the class GrainTimer.cs. As we can see the INFINITE_TIMESPAN should dispose the timer.
}finally { previousTickTime = DateTime.UtcNow; currentlyExecutingTickTask = null; // if this is not a repeating timer, then we can // dispose of the timer. if (timerFrequency == Constants.INFINITE_TIMESPAN) DisposeTimer(); }
The text was updated successfully, but these errors were encountered:
Thanks for the detailed description, @Gabrielm1. Currently, the TestKit does not "schedule" or manage lifetimes of reminders or timers. Additionally, it keeps no record of reminders that have ticked or timers that have fired. The API simply enables calling the grain methods from a test. For now, this issue is by design/a known limitation.
There is a discussion about an improved API on PR #60. I have a work-in-progress branch where I've been exploring a new test fixture component to manage time and fire/tick "due" reminders/timers with minimal changes to the TestKit... just a layering on top of the existing API. Progress has been slow due to work constraints, but I have an upcoming Orleans project that may re-kickstart this work.
Hi,
I noticed that the Timeout.InfiniteTimeSpan when it's used with the RegisterTimer doesn't work as expected. It's should only executed once, but it appears not to be.
Here is a dummy RegisterTimer
public Task DummyTimer() { RegisterTimer( o => SimpleMethod(), "dummy", TimeSpan.FromSeconds(5), Timeout.InfiniteTimeSpan) };
Here is the dummy test :
await DummyTimer() await Silo.FireAllTimersAsync(); service.Verify(s => s.SimpleMethod(), Times.Once ); await Silo.FireAllTimersAsync(); service.Verify(s => s.SimpleMethod(), Times.Once );
Here is the problem, the method SimpleMethod() is called two time, but should be only called once.
Here is the sample of the implementation of the class GrainTimer.cs. As we can see the INFINITE_TIMESPAN should dispose the timer.
}finally { previousTickTime = DateTime.UtcNow; currentlyExecutingTickTask = null; // if this is not a repeating timer, then we can // dispose of the timer. if (timerFrequency == Constants.INFINITE_TIMESPAN) DisposeTimer(); }
The text was updated successfully, but these errors were encountered: