diff options
author | Bryan C. Mills <bcmills@google.com> | 2020-04-09 11:09:00 -0400 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-04-10 01:36:31 +0000 |
commit | 7b90c1c0c42099248fbb849e8a1c3251984688ac (patch) | |
tree | ebbf6769b11bc9c4ac5c5c400d31b2ec2f198380 /src/os | |
parent | 28157b3292a9da90a7ceea89e9b01d9dd03b4979 (diff) | |
download | go-git-7b90c1c0c42099248fbb849e8a1c3251984688ac.tar.gz |
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 <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/exec/exec_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
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") |