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: Synchronise writes to dockerCompose.containers map #812

Merged
merged 1 commit into from
Feb 7, 2023
Merged

fix: Synchronise writes to dockerCompose.containers map #812

merged 1 commit into from
Feb 7, 2023

Conversation

joshua-hill-form3
Copy link
Contributor

@joshua-hill-form3 joshua-hill-form3 commented Feb 7, 2023

What does this PR do?

Prevent concurrent writes to the dockerCompose.containers map using a mutex.

Why is it important?

To avoid occasional panics when running tests that use Docker Compose with multiple wait strategies.

Related issues

@netlify
Copy link

netlify bot commented Feb 7, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 10d2bb8
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/63e29b4009ca570008414088
😎 Deploy Preview https://deploy-preview-812--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 settings.

@joshua-hill-form3 joshua-hill-form3 marked this pull request as ready for review February 7, 2023 18:39
@joshua-hill-form3 joshua-hill-form3 requested a review from a team as a code owner February 7, 2023 18:39
@joshua-hill-form3 joshua-hill-form3 changed the title Synchronise writes to containers map Synchronise writes to dockerCompose.containers map Feb 7, 2023
@joshua-hill-form3 joshua-hill-form3 changed the title Synchronise writes to dockerCompose.containers map fix: Synchronise writes to dockerCompose.containers map Feb 7, 2023
@mdelapenya mdelapenya self-assigned this Feb 7, 2023
@mdelapenya mdelapenya added the bug An issue with the library label Feb 7, 2023
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.

Thanks for the big report and the quick fix! Much appreciated

LGTM

@mdelapenya mdelapenya merged commit 713a559 into testcontainers:main Feb 7, 2023
@joshua-hill-form3 joshua-hill-form3 deleted the containers-mutex branch February 8, 2023 09:16
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Feb 10, 2023
* main:
  chore: update Docker labels for containers (testcontainers#813)
  fix: nil pointer dereference in HealthStrategy (testcontainers#802)
  fix: Synchronise writes to containers map (testcontainers#812)
  chore(deps): bump google.golang.org/api from 0.108.0 to 0.109.0 in /examples (testcontainers#810)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#806)
  chore: restructure Docker helper methods (testcontainers#799)
  Verify Reaper state to create new or return existing instance (testcontainers#782)
  docs: add intel as user (testcontainers#798)
  chore: bump containerd in examples (testcontainers#797)
  chore(deps): bump github.com/containerd/containerd from 1.6.15 to 1.6.16 (testcontainers#793)
  chore: extract docker host calculation to an internal package (testcontainers#796)
  chore: run "go mod tidy" automatically when creating examples (testcontainers#794)
  chore: build images with backoff retries (testcontainers#792)
  fix: use right import package for compose in docs (testcontainers#791)
  chore(deps): bump google.golang.org/grpc from 1.52.1 to 1.52.3 in /examples (testcontainers#790)
  Add devcontainer file (testcontainers#765)
  chore: check dependabot dependencies weekly (testcontainers#789)
  chore(deps): bump google.golang.org/grpc from 1.52.0 to 1.52.1 in /examples (testcontainers#783)
  chore: support for titles in examples (testcontainers#775)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Feb 14, 2023
* main:
  chore(deps): bump google.golang.org/grpc from 1.52.3 to 1.53.0 in /examples (testcontainers#827)
  chore(deps): bump github.com/containerd/containerd from 1.6.16 to 1.6.17 (testcontainers#817)
  chore(deps): bump golang.org/x/text from 0.6.0 to 0.7.0 (testcontainers#818)
  chore(deps): bump golang.org/x/sys from 0.4.0 to 0.5.0 (testcontainers#816)
  chore(deps): bump github.com/jackc/pgx/v4 in /examples/cockroachdb (testcontainers#819)
  chore: update Docker labels for containers (testcontainers#813)
  fix: nil pointer dereference in HealthStrategy (testcontainers#802)
  fix: Synchronise writes to containers map (testcontainers#812)
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.

[Bug]: Concurrent map writes in dockerCompose.Up
2 participants