Skip to content

Commit 16b00c9

Browse files
ianlancetayloradg
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Minux Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/22070 Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent d389a19 commit 16b00c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/crash_cgo_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,19 @@ func TestCgoCheckBytes(t *testing.T) {
162162
}
163163

164164
cmd := testEnv(exec.Command(exe, "CgoCheckBytes"))
165+
cmd.Env = append(cmd.Env, "GODEBUG=cgocheck=0")
165166

166167
start := time.Now()
167168
cmd.Run()
168169
d1 := time.Since(start)
169170

170171
cmd = testEnv(exec.Command(exe, "CgoCheckBytes"))
171-
cmd.Env = append(cmd.Env, "GODEBUG=cgocheck=0")
172172

173173
start = time.Now()
174174
cmd.Run()
175175
d2 := time.Since(start)
176176

177-
if d2*10 < d1 {
177+
if d1*20 < d2 {
178178
t.Errorf("cgo check too slow: got %v, expected at most %v", d1, d2*10)
179179
}
180180
}

0 commit comments

Comments
 (0)