-
-
Notifications
You must be signed in to change notification settings - Fork 149
[CI] Wait for Docker services to be healthy before running tests #1134
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
base: main
Are you sure you want to change the base?
Conversation
| working-directory: examples | ||
| run: docker compose up -d | ||
|
|
||
| - name: Wait for services to be healthy |
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.
@Guikingone if this works, we can get rid of the 10sec sleep?
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.
Yes.
I'm not sure it will solve the Opensearch, when launched locally, it can be considered as "healthy" and not be fully operational, to test on this one to ensure that we're not missing 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.
@Guikingone I am looking into OpenSearch and ElasticSearch locally in more detail. You are right that this does not remove the OS issue for now, but from my local work, it was a necessary step to rule out that the container was up an running before trying out the tests.
|
had the same issue and went lazy on it since you're on it ... thanks already! :) |
|
Tried to restart the failing tests a couple of times ... at least it doesn't solve them being flaky here due to 403 - or is that a new issue now? |
|
@chr-hertel I am also working on: #1137 but this week have been busy with work. It is a combination of both services not being ready in time and OpenSearch and ElasticSearch docker network / initial setup. In the other PR, sometimes if timed right it works, and if not either fails. I am trying different ways to make this as reliable / consistent as possible. Maybe we can close this PR and I move this step in the other one. But I have this issue living rent-free in my head for days now. |
|
Just wanted to understand, easy - thanks for the explanation! Will think about it as well ... |
Adding a wait step in integration-tests workflow that checks all Docker Compose services are healthy before running store commands. In this PR #1109 I had the issue that OpenSearch integrations tests would sometimes pass sometimes not.
The step waits up to 5 minutes, checking every 5 seconds, for all services to report either "healthy" status or have no healthcheck defined.
I did as many checks as I could on my local macos machine for all services in compose.yaml and at least it works on my machine, but I am not a bash expert, so do not hold back with your reviews 😄