From: Bryan C. Mills Date: Thu, 9 Apr 2020 15:09:00 +0000 (-0400) Subject: os/exec: extend grace period in TestExtraFiles to 20% of overall deadline X-Git-Tag: go1.15beta1~604 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7b90c1c0c42099248fbb849e8a1c3251984688ac;p=gostls13.git os/exec: extend grace period in TestExtraFiles to 20% of overall deadline Updates #25628 Change-Id: I938a7646521b34779a3a57833e7ce9d508b58faf Reviewed-on: https://go-review.googlesource.com/c/go/+/227765 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 8609b28bd4..d9c9812554 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -690,8 +690,12 @@ func TestExtraFiles(t *testing.T) { // Use a deadline to try to get some output even if the program hangs. ctx := context.Background() if deadline, ok := t.Deadline(); ok { + // Leave a 20% grace period to flush output, which may be large on the + // linux/386 builders because we're running the subprocess under strace. + deadline = deadline.Add(-time.Until(deadline) / 5) + var cancel context.CancelFunc - ctx, cancel = context.WithDeadline(ctx, deadline.Add(-time.Second)) + ctx, cancel = context.WithDeadline(ctx, deadline) defer cancel() } c := helperCommandContext(t, ctx, "read3")