From 7426150822b090025d2bc74c96e3642aeea17567 Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Tue, 30 Jul 2024 11:26:20 +0100 Subject: [PATCH] debugging: use new reaper image 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. --- docker_test.go | 4 ++-- internal/config/config.go | 3 ++- modules/compose/compose_api_test.go | 2 +- wait/exec_test.go | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docker_test.go b/docker_test.go index f3502ffa28..243b9557cb 100644 --- a/docker_test.go +++ b/docker_test.go @@ -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) { diff --git a/internal/config/config.go b/internal/config/config.go index 7f0039cecb..b51745bc35 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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 diff --git a/modules/compose/compose_api_test.go b/modules/compose/compose_api_test.go index eff783005c..41426d6e2f 100644 --- a/modules/compose/compose_api_test.go +++ b/modules/compose/compose_api_test.go @@ -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 diff --git a/wait/exec_test.go b/wait/exec_test.go index d978b207af..3a37947cc6 100644 --- a/wait/exec_test.go +++ b/wait/exec_test.go @@ -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) }()