You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is running in github actions so I don't have access to it.
What happened?
When using testcontainers with the -race flag enabled, a race is detected within the testcontainers package. It seems to be due to some code paths not using the reaperMux when accessing the session identifiers. For example here:
WARNING: DATA RACE
Write at 0x000001a3cc50 by goroutine 17:
github.com/testcontainers/testcontainers-go.reuseOrCreateReaper()
/home/runner/go/pkg/mod/github.com/testcontainers/[email protected]/reaper.go:155 +0x624
Previous read at 0x000001a3cc50 by goroutine 14:
github.com/testcontainers/testcontainers-go.(*DockerProvider).CreateContainer()
/home/runner/go/pkg/mod/github.com/testcontainers/[email protected]/docker.go:881 +0xb34
Additional information
No response
The text was updated successfully, but these errors were encountered:
Oh, you are totally right! I introduced the race condition checking if the reaperInstance is nil 🤦
I'll work on a fix ASAP. Thanks for reporting this.
Just to let you know, we are working on a draft document for an eventual v1 release, in which we'd like to refine all the bootstrapping of the library, in particular how config, reaper and test session is initialised. So it would be fixed at that time in a more proper manner. Nevertheless, I'll tackle this bug now.
Testcontainers version
0.24.1
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
amd64
Go version
1.21
Docker version
Docker info
What happened?
When using testcontainers with the
-race
flag enabled, a race is detected within the testcontainers package. It seems to be due to some code paths not using thereaperMux
when accessing the session identifiers. For example here:https://github.com/testcontainers/testcontainers-go/blob/main/docker.go#L881
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: