diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-04-17 23:55:17 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-04-17 23:55:17 +0000 |
commit | ea675e51edd8d13eea32c5070163ec0f14b387dd (patch) | |
tree | 8a0194d7a74fe1d3e338b1264736cc80e6610a0a /libgo | |
parent | 8c17bac9e2385abcfae13a89b9c2d6d7ed351711 (diff) |
os/signal: disable loading of history during test
Bring in https://golang.org/cl/98616 from gc tip.
Original CL description:
This change modifies Go to disable loading of users' shell history for
TestTerminalSignal tests. TestTerminalSignal, as part of its workload,
will execute a new interactive bash shell. Bash will attempt to load the
user's history from the file pointed to by the HISTFILE environment
variable. For users with large histories that may take up to several
seconds, pushing the whole test past the 5 second timeout and causing
it to fail.
Reviewed-on: https://go-review.googlesource.com/107624
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259452 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/os/signal/signal_cgo_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libgo/go/os/signal/signal_cgo_test.go b/libgo/go/os/signal/signal_cgo_test.go index 84a2a08ce9b..16aeea8221c 100644 --- a/libgo/go/os/signal/signal_cgo_test.go +++ b/libgo/go/os/signal/signal_cgo_test.go @@ -89,6 +89,8 @@ func TestTerminalSignal(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() cmd := exec.CommandContext(ctx, bash, "--norc", "--noprofile", "-i") + // Clear HISTFILE so that we don't read or clobber the user's bash history. + cmd.Env = append(os.Environ(), "HISTFILE=") cmd.Stdin = slave cmd.Stdout = slave cmd.Stderr = slave |