From 7e5c93134ece66cfc97c65d1703eb16e7882411b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 16 Mar 2025 02:34:06 +0900 Subject: [PATCH] helper: raise WaitDelay during tests Helper runs very slowly with race detector. This prevents it from timing out. Signed-off-by: Ophestra --- helper/helper_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helper/helper_test.go b/helper/helper_test.go index 27c3171..a37a736 100644 --- a/helper/helper_test.go +++ b/helper/helper_test.go @@ -48,10 +48,11 @@ func argFChecked(argsFd, statFd int) (args []string) { } // this function tests an implementation of the helper.Helper interface -func testHelper(t *testing.T, - createHelper func(ctx context.Context, setOutput func(stdoutP, stderrP *io.Writer), stat bool) helper.Helper, - prefix string, -) { +func testHelper(t *testing.T, createHelper func(ctx context.Context, setOutput func(stdoutP, stderrP *io.Writer), stat bool) helper.Helper) { + oldWaitDelay := helper.WaitDelay + helper.WaitDelay = 16 * time.Second + t.Cleanup(func() { helper.WaitDelay = oldWaitDelay }) + t.Run("start helper with status channel and wait", func(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) stdout, stderr := new(strings.Builder), new(strings.Builder)