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

Fix flaky bleve server test #219

Merged
merged 2 commits into from
Jul 24, 2023
Merged

Fix flaky bleve server test #219

merged 2 commits into from
Jul 24, 2023

Conversation

timburks
Copy link
Contributor

@timburks timburks commented Jul 24, 2023

Investigating #218... tests were failing when DialTimeout() returns immediately with "connection refused". Increasing the timeout didn't help, and reviewing the timestamps in the log file, it was clear that the failure was immediate -- I'm guessing that the goroutine running the server hadn't even started, so when the connection was attempted it failed immediately because there was nothing to connect with. I suspect that DialTimeout() wasn't written for cases where the server hadn't been started yet but was instead intended to handle slow network connections and slow server responses.

Adding an explicit sleep allowed the test to pass on all 3 of 3 attempts (it was failing 1/2 to 2/3 of the time previously).

@timburks timburks requested a review from theganyo July 24, 2023 21:27
@timburks timburks changed the title Increase timeout for connecting to bleve server Fix flaky bleve server test Jul 24, 2023
@theganyo
Copy link
Member

Yes, I expect this is more of a network and server timeout... and having no port in existence leads to a quick and painless death. And while 1s is probably overkill and some kind of backoff retry would be the best option, I see no reason to worry about any of that here.

@timburks timburks merged commit 591c60a into apigee:main Jul 24, 2023
9 checks passed
@timburks timburks deleted the bleve-tests branch September 18, 2023 17:36
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