Skip to content
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(redpanda): race condition on port check #2692

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Aug 6, 2024

Use SkipInternalCheck to wait for ports to be bound externally only before trying to get the mapped port. This fixes a race condition in the setup of the container which was causing random test failures.

@stevenh stevenh requested a review from a team as a code owner August 6, 2024 20:28
Copy link

netlify bot commented Aug 6, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 8648345
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66bcc8879baec30008f73b51
😎 Deploy Preview https://deploy-preview-2692--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Use SkipInternalCheck to wait for ports to be bound externally only
before trying to get the mapped port. This fixes a race condition in the
setup of the container which was causing random test failures.
Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@weeco I'm going to merge this as is, to make progress, although I'd like to get your feedback if possible, as a redpanda contributor, in an eventual issue if you find any concern with this PR: in the end, it only adds stronger wait conditions to mark the container as ready, so I think it's safe to merge.

Thanks in advance

@mdelapenya mdelapenya added the bug An issue with the library label Aug 16, 2024
@mdelapenya mdelapenya self-assigned this Aug 16, 2024
@mdelapenya mdelapenya merged commit 5ec0064 into testcontainers:main Aug 16, 2024
110 of 112 checks passed
@weeco
Copy link
Contributor

weeco commented Aug 16, 2024

That looks fine to me, thanks for the fix

mdelapenya added a commit that referenced this pull request Aug 16, 2024
* main:
  fix: config via environment (#2725)
  fix(redpanda): race condition on port check (#2692)
  fix: logging restart (#2697)
  fix!: docker authentication setup (#2727)
  chore: improve error wrapping (#2720)
  chore: run make tests in verbose mode (#2734)
  chore(deps): bump github.com/docker/docker from 27.1.0+incompatible to 27.1.1+incompatible (#2733)
  fix(kafka): port race on start (#2696)
  docs: fix broken doc tags (#2732)
  fix: nginx request failures (#2723)
  fix(compose): container locking (#2722)
  fix(wait): log test timeout (#2716)
  chore: increase timeout values (#2719)
  chore: remove unused parameters (#2721)
  chore(mockserver): silence warning about internal port (#2730)
  feat(wait): skip internal host port check (#2691)
mdelapenya added a commit to stevenh/testcontainers-go that referenced this pull request Sep 6, 2024
* main: (33 commits)
  docs: refine heading badges in README (testcontainers#2770)
  feat(wait): for file (testcontainers#2731)
  feat(compose): select services via profiles (testcontainers#2758)
  chore(deps): bump mkdocs-markdownextradata-plugin from 0.2.5 to 0.2.6 (testcontainers#2761)
  fix: update template too (testcontainers#2763)
  chore(deps): bump actions/checkout from 4.1.1 to 4.1.7 (testcontainers#2762)
  chore(deps): bump mkdocs-include-markdown-plugin from 6.0.4 to 6.2.2 (testcontainers#2760)
  fix: check if the discovered docker socket responds (testcontainers#2741)
  Upgrade milvus-io/milvus-sdk-go to avoid checksum mismatch. (testcontainers#2753)
  Fix trailing slash on Image Prefix (testcontainers#2747)
  chore: use new testcontainers/ryuk:0.9.0 image (testcontainers#2750)
  chore(deps): bump minimal Go version from 1.21 to 1.22 (testcontainers#2743)
  chore(deps): bump github/codeql-action from 3.24.9 to 3.25.15 (testcontainers#2677)
  fix: use of log.Fatal in main (testcontainers#2739)
  chore: prepare for next minor development cycle (0.34.0)
  chore: use new version (v0.33.0) in modules and examples
  fix: authentication tests on WSL (testcontainers#2706)
  fix(registry): compatibility with WSL (testcontainers#2705)
  fix: config via environment (testcontainers#2725)
  fix(redpanda): race condition on port check (testcontainers#2692)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants