]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: do not apply kill timeout to go test with -bench
authorSam Thanawalla <samthanawalla@google.com>
Mon, 10 Feb 2025 21:06:02 +0000 (21:06 +0000)
committerSam Thanawalla <samthanawalla@google.com>
Thu, 13 Feb 2025 17:51:00 +0000 (09:51 -0800)
The testing package already does this. go test should do the same thing.

Fixes: #69181
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Change-Id: I942bd09c5832b48d498a2eb1f1500e1d294d0a2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/648236
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/test/test.go

index 28ab6a09355020883157ef42233a9677b1a7fb99..2ee2aa6f415d5ccc6239cc5e8266768e64158bb3 100644 (file)
@@ -802,9 +802,9 @@ func runTest(ctx context.Context, cmd *base.Command, args []string) {
        // to that timeout plus one minute. This is a backup alarm in case
        // the test wedges with a goroutine spinning and its background
        // timer does not get a chance to fire.
-       // Don't set this if fuzzing, since it should be able to run
+       // Don't set this if fuzzing or benchmarking, since it should be able to run
        // indefinitely.
-       if testTimeout > 0 && testFuzz == "" {
+       if testTimeout > 0 && testFuzz == "" && testBench == "" {
                // The WaitDelay for the test process depends on both the OS I/O and
                // scheduling overhead and the amount of I/O generated by the test just
                // before it exits. We set the minimum at 5 seconds to account for the OS