From 4ba010501965cca2091ac1e702105c623ea115b5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 17 Apr 2018 23:55:17 +0000 Subject: [PATCH] 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 From-SVN: r259452 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/os/signal/signal_cgo_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index f85a6671416..aeba5254fe6 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -2c7093358e5f5ebeb102d44d1036ca0a807d46a5 +b367349d85f315e94e10ee2d76a7c6a46b993dcb The first line of this file holds the git revision number of the last merge done from the gofrontend repository. 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 -- 2.30.2