-
Notifications
You must be signed in to change notification settings - Fork 15
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
Interop binaries: wait for database to be up #2006
Conversation
Nice find, David. @c02-student, since none of us have been able to reproduce this, do you think you could check whether this patch fixes your issue? |
interop_binaries/setup.sh
Outdated
@@ -1,4 +1,5 @@ | |||
#!/bin/bash | |||
until pg_isready -U postgres; do sleep 1; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will wait for postgres forever, right? I think we should give up after some delay so that e.g. postgres crashing on startup due to misconfiguration doesn't cause a test to hang forever.
@@ -1,4 +1,5 @@ | |||
#!/bin/bash | |||
timeout 5m bash -c 'until pg_isready -U postgres; do sleep 1; done' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider running this script with set -e
or perhaps better adding || "timeout waiting for postgres to be ready" && exit 1
. Otherwise the script will fall through on failure.
This is a nit since we'll be able to see the results in the logs anyways, can take it or leave it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to resolve the issue with this change !
I have tested it in my local environment for both release/0.5 and 0.6.0-prerelease-1, and both passed successfully.
Thank you .
This waits for the Postgres database to come up before starting
janus_interop_aggregator
etc. This is for #1977. I tried this out locally, and saw the following on stdout from thesetup
job. (the first two lines are frompg_isready
)