]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: deflake TestCgoCheckBytes
authorIan Lance Taylor <iant@golang.org>
Wed, 24 Feb 2016 01:16:21 +0000 (17:16 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 24 Feb 2016 01:49:05 +0000 (01:49 +0000)
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: Minux Ma <minux@golang.org>
src/runtime/crash_cgo_test.go

index 63769e801c104c70561850ec21c0fb5db4c20a15..635e271d5d3fc4f0fbe294b31ce501b0a345b8d3 100644 (file)
@@ -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)
        }
 }