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

util: prevent PublicIP from taking tens of seconds #436

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

mvdan
Copy link
Contributor

@mvdan mvdan commented Jan 18, 2022

(see commit message)

Closes #434.

go-external-ip's default timeout is 30s, which is too long.
Use 3s, which seems far more reasonable, and document it.

It's not entirely clear why it's timing out; it seems like one of the
providers is currently being slow or just not responding at all.
It doesn't really matter; one of the providers not responding shouldn't
hang our software for half a minute.

Before this change, the ipfssync and ipfssync/subpub packages
took between 30s and 60s to run their tests, presumably since they
obtain the public IP more than once.

With this change, the packages now take 3-6s to test, predictably.

Closes vocdoni#434.
@mvdan
Copy link
Contributor Author

mvdan commented Jan 18, 2022

I think keeping the 1m test timeout per package is useful, precisely because it will help us keep our tests reasonably fast and catch long timeouts or sleeps like this one :)

Copy link
Contributor

@altergui altergui left a comment

Choose a reason for hiding this comment

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

looks great to me

@NateWilliams2
Copy link
Contributor

looks great 👍

@mvdan mvdan merged commit 1a9b139 into vocdoni:master Jan 18, 2022
@mvdan mvdan deleted the externalip-timeout branch January 24, 2022 12:52
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