From 399bc7699f516bcf979eea366b3298642bbd9901 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 22 Nov 2026 19:01:21 -0800 Subject: [PATCH] test: sync control child runs to the parent test deadline, not a fixed 45 s Co-Authored-By: Claude Opus 5.5 --- seaweed-block/core/storage/data_sync_linux_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seaweed-block/core/storage/data_sync_linux_test.go b/seaweed-block/core/storage/data_sync_linux_test.go index e91897834f..fc5fab3489 100644 --- a/seaweed-block/core/storage/data_sync_linux_test.go +++ b/seaweed-block/core/storage/data_sync_linux_test.go @@ -290,7 +290,13 @@ func TestSyncControlsIgnoreAmbientAllocation(t *testing.T) { {"crash-matrix", "TestFdatasyncAcknowledgedWritesSurviveSIGKILL", "prezero"}, } { t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second) + // The crash-matrix child is fdatasync-bound and takes 1-35 s on a + // slow disk, so it runs until the parent test's deadline rather + // than a fixed budget. + ctx, cancel := context.WithCancel(context.Background()) + if d, ok := t.Deadline(); ok { + ctx, cancel = context.WithDeadline(context.Background(), d.Add(-10*time.Second)) + } defer cancel() cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^"+tc.test+"$") cmd.Env = append(os.Environ(), "SWBLOCK_TEST_SYNC_CRASH=", "SWBLOCK_TEST_SYNC_CHILD_FAILURE=", "SWBLOCK_ALLOCATION="+tc.allocation, "SWBLOCK_PREZERO=0")