Skip to content

testing: -timeout affects benchmarks too (regression) #18845

Description

@evverx

This regression was introduced in ead08e9#diff-70e628298261565d825f7199d13042f2L758

package bench

import (
        "testing"
        "time"
)

func BenchmarkSleep10(b *testing.B) {
        time.Sleep(10 * time.Second)
}
go test -v -bench=. -timeout=1s
  • go version go1.7.5 linux/amd64
BenchmarkSleep10-2             1        10000282918 ns/op
PASS
  • go version devel +6bdb0c1 Sun Jan 29 00:49:56 2017 +0000 linux/amd64
panic: test timed out after 1s

Activity

  1. ALTree commented on Jan 29, 2017

    @ALTree
    Member

    Looks like stopAlarm() was removed by rsc between patch set 4 and 5, but in the CL discussion I see nothing that can explain why.

    I've cooked up a quick patch and in theory just adding back a stopAlarm() call after runExamples() should fix the problem, but I'm not confident I'm not missing something.

  2. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Jan 29, 2017
  3. gopherbot commented on Jan 29, 2017

    @gopherbot
    Contributor

    CL https://golang.org/cl/35956 mentions this issue.

  4. added this to the Go1.8Maybe milestone on Jan 30, 2017
  5. gopherbot commented on Feb 2, 2017

    @gopherbot
    Contributor

    CL https://golang.org/cl/36125 mentions this issue.

  6. added a commit that references this issue on Feb 2, 2017
    4707045
  7. locked and limited conversation to collaborators on Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions