-
-
Notifications
You must be signed in to change notification settings - Fork 586
fix(influxdb): Respect custom waitStrategy #2845
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
fix(influxdb): Respect custom waitStrategy #2845
Conversation
fix(influxdb): Respect passed waitStrategy
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
stevenh
left a comment
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.
Thanks for PR, tried reproducing but must be missing something
Co-authored-by: Steven Hartland <stevenmhartland@gmail.com>
stevenh
left a comment
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.
Looking cleaner, did some testing locally which triggered some additional suggestions.
Move Shutdown check to WithInitDb
mdelapenya
left a comment
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.
LGTM, thanks!
stevenh
left a comment
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.
Almost there, just two suggestions
Co-authored-by: Steven Hartland <stevenmhartland@gmail.com>
Co-authored-by: Steven Hartland <stevenmhartland@gmail.com>
mdelapenya
left a comment
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.
Added a final nit about a comment.
Other than that, LGTM, great job @marcinmilewski93 during the review 🙇
|
Thanks everybody here for the thorough review. Great job! |
* main: (76 commits) fix(influxdb): Respect custom waitStrategy (testcontainers#2845) fix: only upload to sonar on ubuntu-latest (testcontainers#2891) fix: build artifact name properly (testcontainers#2890) fix: do not run sonar upload when ryuk is disabled (testcontainers#2889) fix: update GH actions for uploading/downloading artifacts (testcontainers#2888) feat(ci): Enable master moby with rootless (testcontainers#2880) fix(redpanda): temporary file use chore(deps): bump actions/download-artifact from 3.0.2 to 4.1.8 (testcontainers#2676) chore(deps): bump actions/upload-artifact from 3.1.3 to 4.4.3 (testcontainers#2885) fix!: port forwarding clean up and make private (testcontainers#2881) chore: resolve AWS deprecations for localstack (testcontainers#2879) docs: fix new lifecycle hooks section (testcontainers#2875) fix: host access port instability (testcontainers#2867) feat: add build to life cycle hooks (testcontainers#2653) fix: typo in containerd integration (testcontainers#2873) chore(deps): bump mkdocs-include-markdown-plugin from 6.0.4 to 6.2.2 (testcontainers#2806) chore: use testify instead of t.Error (testcontainers#2871) ci: enable perfsprint linter (testcontainers#2872) chore(deps): bump mkdocs-markdownextradata-plugin from 0.2.5 to 0.2.6 (testcontainers#2807) chore: use testcontainers.RequireContainerExec (testcontainers#2870) ...
* main: docs: better contribution guidelines (testcontainers#2893) fix(influxdb): Respect custom waitStrategy (testcontainers#2845)
* main: (234 commits) chore(ci): add Github labels based on PR title (testcontainers#2914) chore(gha): Use official setup-docker-action (testcontainers#2913) chore(ci): enforce conventional commits syntax in PR titles (testcontainers#2911) feat(nats): WithConfigFile - pass a configuration file to nats server (testcontainers#2905) chore: enable implicit default logger only in testing with -v (testcontainers#2877) fix: container binds syntax (testcontainers#2899) refactor(cockroachdb): to use request driven options (testcontainers#2883) chore(deps): bump actions/setup-go from 5.0.0 to 5.1.0 (testcontainers#2904) chore(deps): bump ossf/scorecard-action from 2.3.1 to 2.4.0 (testcontainers#2903) chore(deps): bump test-summary/action from 2.3 to 2.4 (testcontainers#2902) feat(wait): strategy walk (testcontainers#2895) feat(wait): tls strategy (testcontainers#2896) docs: better contribution guidelines (testcontainers#2893) fix(influxdb): Respect custom waitStrategy (testcontainers#2845) fix: only upload to sonar on ubuntu-latest (testcontainers#2891) fix: build artifact name properly (testcontainers#2890) fix: do not run sonar upload when ryuk is disabled (testcontainers#2889) fix: update GH actions for uploading/downloading artifacts (testcontainers#2888) feat(ci): Enable master moby with rootless (testcontainers#2880) fix(redpanda): temporary file use ...
What does this PR do?
The purpose of this PR is to respect the provided
waitStrategyfor the InfluxDB container, rather than overriding it by default. This change allows the use of a customwaitStrategywhen specified; if none is provided, the defaultwaitStrategywill be applied, maintaining the same configuration as before this modification.Why is it important?
In the current implementation, it's not possible to use a custom
waitStrategyand in my case the default strategy marks the container as ready too early. The container is still not ready to receive writes as you can see below. Customizing thewaitStrategyfor example to check the/healthstatus solved this issue. Example log output when container is not ready yet:After this modification different strategy could be employed, for example, to verify if InfluxDB is
ready for queries and writesas you can see on below health check response:{ "name": "influxdb", "message": "ready for queries and writes", "status": "pass", "checks": [], "version": "2.0.7", "commit": "2a45f0c037" }Related issues
How to test this PR
I have added a test that uses a custom
waitStrategyto verify this behavior.