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 exponential backoff timeout to test #2969

Merged
merged 2 commits into from
Aug 18, 2015
Merged

Conversation

uaalto
Copy link
Contributor

@uaalto uaalto commented Aug 18, 2015

Closes #2968

Adapts the test to reduce the timeout within a lower boundary to keep it reasonable. Without this, the test depend on the system, which will require continuous tuning and/or complicate reproducibility.

@myleshorton
Copy link
Contributor

For some reason I thought the issue with the test was with the cert itself. Does it just appear that way but is actually an issue with the timeout @uaalto?

@uaalto
Copy link
Contributor Author

uaalto commented Aug 18, 2015

The previous error was caused by the connection succeeding and then trying to do the TLS handshake. Because we didn't provide any certificates in the test code (assuming it wasn't going to reach that stage), it was failing to use a proper certificate.
Once this was fixed, it turns out that sometimes the the 5000 microseconds timeout is too high, and the connection actually succeeds. The test relies on the connections timing out. Since I couldn't replicate the issue after 1000 runs in my machine, I assumed that it depends a lot on the machine, so I propose a way to adapt to faster machines.
The code will just reduce the max value of the timeout and repeat the test. It will do this until a connection succeeded in a suspiciously low time, which will be logged for further investigation.

@myleshorton
Copy link
Contributor

Gotcha -- OK let's give it a shot!

myleshorton added a commit that referenced this pull request Aug 18, 2015
Add exponential backoff timeout to test
@myleshorton myleshorton merged commit c07668c into valencia Aug 18, 2015
@myleshorton myleshorton deleted the tlsdialer-tests branch August 18, 2015 18:57
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.

2 participants