Skip to content

Commit 8420b72

Browse files
committed
chore: skip reaper tests if ryuk is disabled
1 parent b646bba commit 8420b72

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

reaper_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ func TestContainerTerminationWithoutReaper(t *testing.T) {
309309
}
310310

311311
func Test_NewReaper(t *testing.T) {
312+
config.Reset() // reset the config using the internal method to avoid the sync.Once
313+
tcConfig := config.Read()
314+
if tcConfig.RyukDisabled {
315+
t.Skip("Ryuk is disabled, skipping test")
316+
}
317+
312318
type cases struct {
313319
name string
314320
req ContainerRequest
@@ -588,6 +594,12 @@ func TestReaper_reuseItFromOtherTestProgramUsingDocker(t *testing.T) {
588594
// already running for the same session id by returning its container instance
589595
// instead.
590596
func TestReaper_ReuseRunning(t *testing.T) {
597+
config.Reset() // reset the config using the internal method to avoid the sync.Once
598+
tcConfig := config.Read()
599+
if tcConfig.RyukDisabled {
600+
t.Skip("Ryuk is disabled, skipping test")
601+
}
602+
591603
const concurrency = 64
592604

593605
timeout, cancel := context.WithTimeout(context.Background(), 5*time.Minute)

0 commit comments

Comments
 (0)