[BUGFIX] Wait longer for database readiness - #94
Merged
Merged
Conversation
waitFor() capped the readiness poll at 11 iterations of "sleep 1", so roughly 11 seconds. Measured against the same images, the time from "run -d" until the port accepts connections is: mysql:8.0 podman 7.0-7.2s docker 12.2-13.2s mariadb:10.4 podman 7.8s docker 8.2s postgres:10 podman 1.3s docker 1.5s Only mysql crosses that limit, and only under docker, whose entrypoint needs about twice as long to initialise a fresh data directory. The workflows select docker now, so the functional mysql suites began to abort intermittently. The cap is 60 seconds instead, which also leaves mariadb a sensible margin. The abort also did not abort. "kill -SIGINT -$$" relies on the SIGINT trap, and that trap is only installed when CI is not "true". In CI the kill was a no-op, so the script carried on and ran the test suite against a database that was not listening, which then reported dozens of "Connection refused" errors instead of the readiness timeout that had actually occurred. waitFor() cleans up and exits directly now.
Documentation renderingYou can find files attached to the below linked Workflow Run URL (Logs). Please note that files only stay for around 5 days!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
waitFor()capped the readiness poll at 11 iterations ofsleep 1— about 11seconds. Measured against the same images, time from
run -duntil the portaccepts connections:
mysql:8.0mariadb:10.4postgres:10Only mysql crosses the limit, and only under docker, whose entrypoint needs
about twice as long to initialise a fresh data directory. Since the workflows
now select docker, the functional mysql suites started aborting intermittently.
The cap is 60 s instead, which also gives mariadb a sensible margin.
The abort did not abort
kill -SIGINT -$$relies on the SIGINT trap, and that trap is only installedwhen
CIis not"true". In CI the kill was a no-op, so the script carried onand ran the test suite against a database that was not listening — reporting
dozens of
Connection refusederrors instead of the readiness timeout that hadactually happened.
waitFor()now cleans up and exits directly.