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

Add timeouts to the futures in tests #332

Merged
merged 6 commits into from
May 22, 2021

Conversation

popzxc
Copy link
Contributor

@popzxc popzxc commented May 22, 2021

I was a bit worried by the fact that CI jobs sometimes get stuck on their own.
I think it may be a signal of some hard-to-get but yet dangerous issue (or some kind of misconfiguration).

This PR adds 560-second timeout to the futures spawned in tests, so it will be easier to get enough information and probably find the common pattern in these failures. Also, with it jobs will fail fast, without having to wait for the timeout.

Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems rather opinionated to assume that test-futures will complete in 5 seconds but it would certainly make the CI more responsive and help find the cause but maybe increase the timeout a bit?

So why not but I think fn with_timeout(self) is too implicit it should be renamed something more descriptive such as fn timeout_five_seconds or take the actual timeout period as parameter.

@niklasad1 niklasad1 merged commit 2f234a0 into paritytech:master May 22, 2021
@popzxc popzxc deleted the future-test-timeout branch May 22, 2021 12:42
@dvdplm
Copy link
Contributor

dvdplm commented May 24, 2021

@niklasad1 What do you think of making all requests time out by default? So that all calls are wrapped in a generous default timeout (1min seems good) and users can use with_timeout() to change that if they want?

@niklasad1
Copy link
Member

@niklasad1 What do you think of making all requests time out by default? So that all calls are wrapped in a generous default timeout (1min seems good) and users can use with_timeout() to change that if they want?

We kind of already have this for the WsClient but it's not enabled by default.

I don't know whether having it as default is good but most requests would probably be answered in 1 min :)
It needs to be added to HTTP client too FWIW.

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

Successfully merging this pull request may close these issues.

3 participants