aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-04-03 10:51:37 +0900
committerOphestra <cat@gensokyo.uk>2026-04-03 10:51:37 +0900
commit9e63633fbc49fe45bf121f90a485fae7c9bd9539 (patch)
tree78f8b4daba0ab3955ae4e1d2d7783de5a301429f /container/container_test.go
parent61f981a34a556332c0dfa3a11f96018ca5a98484 (diff)
container: remove test timeouts
These timeouts are no longer useful, and causes spurious test failures under load. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/container_test.go')
-rw-r--r--container/container_test.go13
1 files 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 (