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

Intermittent test failure: timeout from tasks in test_app.test_invite_scenarios #22

Closed
njsmith opened this issue Sep 16, 2019 · 3 comments · Fixed by #32
Closed

Intermittent test failure: timeout from tasks in test_app.test_invite_scenarios #22

njsmith opened this issue Sep 16, 2019 · 3 comments · Fixed by #32
Labels
good first issue Good for newcomers

Comments

@njsmith
Copy link
Member

njsmith commented Sep 16, 2019

Somehow test_invite_scenarios is sometimes failing with a timeout from asks.

This is weird, because that test uses monkeypatching to fake out http requests – it shouldn't be invoking asks at all!

Examples:

https://dev.azure.com/python-trio/snekomatic/_build/results?buildId=966
https://dev.azure.com/python-trio/snekomatic/_build/results?buildId=967

@njsmith
Copy link
Member Author

njsmith commented Sep 17, 2019

Oh, we do make one real HTTP request: we use asks to deliver the fake webhook payload to our app. This is supposed to work reliably, because it only involves a localhost connection from our test process to itself. But the traceback shows the webhook URL, so this must be what's failing.

@njsmith
Copy link
Member Author

njsmith commented Sep 17, 2019

...ah, and the reason it's failing is that we're using the autojump_clock, because I missed that we're doing real I/O here, so if the localhost connection doesn't succeed instantly, then it immediately times out.

So the simple fix would be to stop using the autojump clock, or to use it but set a non-zero "cushion" value. The reason we're using it is because our webhook handler always sleeps for 1 second, to give github's eventually-consistent databases to settle down. So the cost of not using it is just 1 second per test, and for a cushion to do any good, it would have to be set to less than a second, which is getting dicey with

So it sounds like for now we should just disable autojump_clock here. And we'll be able to re-enable it once we have an easy way to enable virtual networking for tests (python-trio/trio#170).

@njsmith njsmith added the good first issue Good for newcomers label Sep 17, 2019
@njsmith
Copy link
Member Author

njsmith commented Sep 17, 2019

Marking this a "good first issue" – the change is literally just to edit the definition of test_invite_scenarios and remove the autojump_clock argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant