diff options
| author | Bryan C. Mills <bcmills@google.com> | 2023-08-22 11:01:29 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-08-22 18:18:19 +0000 |
| commit | 5dda49037209290519f4881a0080caaef025bbd7 (patch) | |
| tree | 2a251ff1fdaf4000831a666e82c58384a8eec18f /src/net/http/serve_test.go | |
| parent | 282cd561bbfceef2e32847212cc535dc888143d9 (diff) | |
| download | go-5dda49037209290519f4881a0080caaef025bbd7.tar.xz | |
net/http: use testenv.Command instead of exec.Command in tests
On Unix platforms, testenv.Command sends SIGQUIT to stuck commands
before the test times out. For subprocesses that are written in Go,
that causes the runtime to dump running goroutines, and in other
languages it triggers similar behavior (such as a core dump).
If the subprocess is stuck due to a bug (such as #57999), that may
help to diagnose it.
For #57999.
Change-Id: Ia2e9d14718a26001e030e162c69892497a8ebb21
Reviewed-on: https://go-review.googlesource.com/c/go/+/521816
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/net/http/serve_test.go')
| -rw-r--r-- | src/net/http/serve_test.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index bb380cf4a5..1f215bd843 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -30,7 +30,6 @@ import ( "net/http/internal/testcert" "net/url" "os" - "os/exec" "path/filepath" "reflect" "regexp" @@ -5005,7 +5004,7 @@ func BenchmarkServer(b *testing.B) { defer ts.Close() b.StartTimer() - cmd := exec.Command(os.Args[0], "-test.run=XXXX", "-test.bench=BenchmarkServer$") + cmd := testenv.Command(b, os.Args[0], "-test.run=XXXX", "-test.bench=BenchmarkServer$") cmd.Env = append([]string{ fmt.Sprintf("TEST_BENCH_CLIENT_N=%d", b.N), fmt.Sprintf("TEST_BENCH_SERVER_URL=%s", ts.URL), |
