Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

evverx opened this issue Jan 29, 2017 · 3 comments

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

evverx opened this issue Jan 29, 2017 · 3 comments


Copy link

@evverx evverx commented Jan 29, 2017

This regression was introduced in ead08e9#diff-70e628298261565d825f7199d13042f2L758

package bench

import (

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
  • go version devel +6bdb0c1 Sun Jan 29 00:49:56 2017 +0000 linux/amd64
panic: test timed out after 1s
Copy link

@ALTree ALTree commented Jan 29, 2017

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.

@ALTree ALTree added the NeedsFix label Jan 29, 2017
Copy link

@gopherbot gopherbot commented Jan 29, 2017

CL mentions this issue.

Copy link

@gopherbot gopherbot commented Feb 2, 2017

CL mentions this issue.

gopherbot pushed a commit that referenced this issue Feb 2, 2017
Fixes #18845

Fixes #18870 (Go 1.8 backport)

Change-Id: Icdc3e2067807781e42f2ffc94d1824aed94d3713
Run-TryBot: Alberto Donizetti <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Ian Lance Taylor <>
(cherry picked from commit 7d8bfdd)
@golang golang locked and limited conversation to collaborators Feb 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.