From 9e63633fbc49fe45bf121f90a485fae7c9bd9539 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 3 Apr 2026 10:51:37 +0900 Subject: [PATCH] container: remove test timeouts These timeouts are no longer useful, and causes spurious test failures under load. Signed-off-by: Ophestra --- container/container_test.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/container/container_test.go b/container/container_test.go index 0d6a7976..bcbcdded 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -16,7 +16,6 @@ import ( "strings" "syscall" "testing" - "time" "hakurei.app/check" "hakurei.app/command" @@ -436,11 +435,8 @@ func TestContainer(t *testing.T) { wantOps, wantOpsCtx := tc.ops(t) wantMnt := tc.mnt(t, wantOpsCtx) - ctx, cancel := context.WithTimeout(t.Context(), helperDefaultTimeout) - defer cancel() - var libPaths []*check.Absolute - c := helperNewContainerLibPaths(ctx, &libPaths, "container", strconv.Itoa(i)) + c := helperNewContainerLibPaths(t.Context(), &libPaths, "container", strconv.Itoa(i)) c.Uid = tc.uid c.Gid = tc.gid c.Hostname = hostnameFromTestCase(tc.name) @@ -450,7 +446,6 @@ func TestContainer(t *testing.T) { } else { c.Stdout, c.Stderr = os.Stdout, os.Stderr } - c.WaitDelay = helperDefaultTimeout *c.Ops = append(*c.Ops, *wantOps...) c.SeccompRules = tc.rules c.SeccompFlags = tc.flags | seccomp.AllowMultiarch @@ -553,11 +548,10 @@ func testContainerCancel( ) func(t *testing.T) { return func(t *testing.T) { t.Parallel() - ctx, cancel := context.WithTimeout(t.Context(), helperDefaultTimeout) + ctx, cancel := context.WithCancel(t.Context()) c := helperNewContainer(ctx, "block") c.Stdout, c.Stderr = os.Stdout, os.Stderr - c.WaitDelay = helperDefaultTimeout if containerExtra != nil { containerExtra(c) } @@ -738,8 +732,7 @@ func init() { const ( envDoCheck = "HAKUREI_TEST_DO_CHECK" - helperDefaultTimeout = 5 * time.Second - helperInnerPath = "/usr/bin/helper" + helperInnerPath = "/usr/bin/helper" ) var (