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
Make FakeScheduler less flaky #92
Conversation
e01a9db
to
8c7e2b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of nits
}); | ||
} | ||
|
||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -88,7 +82,8 @@ public PollSource(TimeSpan timeToCompletion, int finalResult) | |||
FinalResult = finalResult; | |||
} | |||
|
|||
private int Poll(CallSettings callSettings) => Clock.GetCurrentDateTimeUtc() < CompletionTime ? 0 : FinalResult; | |||
private int Poll(CallSettings callSettings) => | |||
Clock.GetCurrentDateTimeUtc() < CompletionTime? 0 : FinalResult; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
|
||
/// <summary> | ||
/// Shorthand method for "run for a logical day". See <see cref="RunUntil(DateTime)"/> for details. | ||
/// <para> | ||
/// Invokes the given action in a separate thread, and then runs the scheduler until of four conditions is met: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We now don't have the flaky "pause" at various points. This does mean that any scheduled actions can easily overlap each other in real time, but it's hard to fix that without flakiness. If it becomes an issue, we can add a configurable pause. The API is now consistent and more clearly documented, and has a couple of "guard" methods to prevent Run being called accidentally instead of RunAsync. (I found I consistently made that error.) For some reason they fail - only on Travis - if run in parallel. That shouldn't be the case, and I'll file a new issue about it, but it can wait for now.
We now don't have the flaky "pause" at various points. This does mean that any scheduled actions can easily overlap each other in real time, but it's hard to fix that without flakiness. If it becomes an issue, we can add a configurable pause.
The API is now consistent and more clearly documented, and
has a couple of "guard" methods to prevent Run being called
accidentally instead of RunAsync. (I found I consistently made that
error.)