Timeout is Incorrectly Treated As Number of Tries
dereekb opened this issue · 2 comments
dereekb commented
In my configuration I have the WAIT_HOSTS_TIMEOUT set to 300.
In my CI environment I noticed that instead of timing out after 300 seconds, it actually timed out after 300 tries.
From the logs:
Docker-compose-wait starting with configuration:
------------------------------------------------
- Hosts to be waiting for: [plug-nginx:4400,plug-server-services:4401,plug-server-services:4402]
- Timeout before failure: 300 seconds
- Sleeping time before checking for hosts availability: 10 seconds
- Sleeping time once all hosts are available: 15 seconds
------------------------------------------------
Waiting 10 seconds before checking for hosts availability
...
(Line 14) Host plug-server-services:4401 not yet available
Host plug-server-services:4401 not yet available
Host plug-server-services:4401 not yet available
...
Host plug-server-services:4401 not yet available
(Line 314) Host plug-server-services:4401 not yet available
(Line 315) Timeout! After 300 seconds some hosts are still not reachable
I'm not familiar with Rust, but in lib.rs line 43 it looks like the count is being compared against timeout read from env.
No big deal, I think I prefer it to be number of tries instead of time, but figured you might want to update the docs or fix the code to reflect the intention.
Great tool by the way!