Skip to content

Commit

Permalink
debugging: use new reaper image
Browse files Browse the repository at this point in the history
Use a new reaper image which retries when it detects new resources so
should fix the reaper shutdown race condition.

Comment out all TESTCONTAINERS_RYUK_DISABLED=true debugging.
  • Loading branch information
stevenh committed Jul 30, 2024
1 parent 99c5114 commit 7426150
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ var debugEnabledTime time.Time
func debugTest(t *testing.T) {
t.Helper()
config.Reset()
t.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
// t.Setenv("TESTCONTAINERS_RYUK_VERBOSE", "true")
// t.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
t.Setenv("TESTCONTAINERS_RYUK_VERBOSE", "true")

oldDebugPrintln := debugPrintln
debugPrintln = func(a ...any) {
Expand Down
3 changes: 2 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
"github.com/magiconair/properties"
)

const ReaperDefaultImage = "testcontainers/ryuk:0.8.1"
// TODO: revert this is just for testing.
const ReaperDefaultImage = "stevenhartland/moby-ryuk:0.9.0"

var (
tcConfig Config
Expand Down
2 changes: 1 addition & 1 deletion modules/compose/compose_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ var debugEnabledTime time.Time
func debugTest(t *testing.T) {
t.Helper()
config.Reset()
t.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
// t.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
t.Setenv("TESTCONTAINERS_RYUK_VERBOSE", "true")

oldDebugPrintln := debugPrintln
Expand Down
6 changes: 3 additions & 3 deletions wait/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ func ExampleExecStrategy() {
start := time.Now()

// TODO: remove, trying without reaper.
oldDisabled := os.Getenv("TESTCONTAINERS_RYUK_DISABLED")
// oldDisabled := os.Getenv("TESTCONTAINERS_RYUK_DISABLED")
oldVerbose := os.Getenv("TESTCONTAINERS_RYUK_VERBOSE")
config.Reset()
os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
// os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true")
os.Setenv("TESTCONTAINERS_RYUK_VERBOSE", "true")
defer func() {
config.Reset()
os.Setenv("TESTCONTAINERS_RYUK_DISABLED", oldDisabled)
// os.Setenv("TESTCONTAINERS_RYUK_DISABLED", oldDisabled)
os.Setenv("TESTCONTAINERS_RYUK_VERBOSE", oldVerbose)
}()

Expand Down

0 comments on commit 7426150

Please sign in to comment.