Commit 16b00c92 authored by Ian Lance Taylor's avatar Ian Lance Taylor Committed by Andrew Gerrand

runtime: deflake TestCgoCheckBytes

Bump up the multiplier to 20.  Also run the fast version first, so that
the slow version is likely to start up faster.

Change-Id: Ia0654cc1212ab03a45da1904d3e4b57d6a8d02a0
Reviewed-on: https://go-review.googlesource.com/19835
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/22070Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent d389a19c
......@@ -162,19 +162,19 @@ func TestCgoCheckBytes(t *testing.T) {
}
cmd := testEnv(exec.Command(exe, "CgoCheckBytes"))
cmd.Env = append(cmd.Env, "GODEBUG=cgocheck=0")
start := time.Now()
cmd.Run()
d1 := time.Since(start)
cmd = testEnv(exec.Command(exe, "CgoCheckBytes"))
cmd.Env = append(cmd.Env, "GODEBUG=cgocheck=0")
start = time.Now()
cmd.Run()
d2 := time.Since(start)
if d2*10 < d1 {
if d1*20 < d2 {
t.Errorf("cgo check too slow: got %v, expected at most %v", d1, d2*10)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment