-
Notifications
You must be signed in to change notification settings - Fork 469
Adding test for IsRunning logic to return fast #764
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
Conversation
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.
nit: rename to SendAsync_HostInErrorState_Returns503Immediately
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.
How can we verify that the polling loop isn't running in this case? Perhaps add a mock verification below that IsRunning was only called once? To facilitate that test, you should probably add a defaulted ctor param for hostRunningPollIntervalMs so we can configure it to a low value like 50ms for these tests so multiple polls would happen (since we're setting the max timeout to 1 second) if your check isn't working.
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.
Yes. Currently, this doesn't test the newly introduced behavior and would pass even before the changes were made. We need a test that covers the scenario and passes with the fix in place (i.e. a test that would fail without your change)
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.
Fixed the PR to address this.
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.
If you make the suggested change below, we can then update this test to verify that IsRunning is called multiple times, verifying that the polling loop is polling.
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.
Fixed this in updated commit
🚢 |
No description provided.