Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: port forwarding race condition #2686

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

stevenh
Copy link
Contributor

@stevenh stevenh commented Aug 6, 2024

Fix port forwarding race condition by waiting for the exposed port which was causing random test failures.

Make errors and parameters more consumable while there.

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

netlify bot commented Aug 6, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 26c4642
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66b2841afb7fc00008b8a1ca
😎 Deploy Preview https://deploy-preview-2686--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.

Fix port forwarding race condition by waiting for the exposed port which
was causing random test failures.

Make errors and parameters more consumable while there.
Copy link
Member

@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, although I'd like to understand the reasons to change the error messages. Do you see a non consistent pattern here?

@mdelapenya mdelapenya self-assigned this Aug 7, 2024
@mdelapenya mdelapenya added the bug An issue with the library label Aug 7, 2024
@stevenh
Copy link
Contributor Author

stevenh commented Aug 7, 2024

LGTM, although I'd like to understand the reasons to change the error messages. Do you see a non consistent pattern here?

Yep when you wrap having multiple failed to prefixes just adds noise, for example compare:
failed to wait: failed to get the network: name conflict

wait: get network: name conflict

With wrapping my rule is to describe the action which errored, which typically is a human readable version of the function call.

@mdelapenya
Copy link
Member

With wrapping my rule is to describe the action which errored, which typically is a human readable version of the function call.

Cool, thanks for the explanation. In that case, I think we're going to need a new PR to update the format to the one you propose. Fine for this PR, and not urgent at all.

Copy link
Member

@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!

@mdelapenya mdelapenya merged commit cbb47fb into testcontainers:main Aug 7, 2024
112 checks passed
@stevenh stevenh deleted the fix/port-forwarding-race branch August 7, 2024 21:54
mdelapenya added a commit that referenced this pull request Aug 9, 2024
* main:
  fix(compose): remove test volumes (#2712)
  chore(mysql): add missing error check in example (#2707)
  chore: remove unused params from defaultPreCreateHook (#2714)
  docs: improve docs for container methods (#2713)
  chore(registry): disable build log (#2711)
  chore: remove obsolete compose version (#2710)
  chore: improve lifecycle errors (#2708)
  docs: add consistent snippets for network creation (#2703)
  test: add retry on system error test (#2687)
  Redpanda Module: Add option for arbitrary bootstrap config (#2666)
  feat(inbucket): expose POP3 and wait for all ports (#2690)
  fix(wait): data race in test (#2698)
  fix(milvus): racy container setup (#2693)
  fix(mongodb): replica test failures (#2699)
  test: racy port creation in port forwarding tests (#2688)
  fix: port forwarding race condition (#2686)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug An issue with the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants