]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: sleep a bit when waiting for running debug call goroutine
authorIan Lance Taylor <iant@golang.org>
Tue, 5 Nov 2019 04:06:19 +0000 (20:06 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 8 Nov 2019 18:00:54 +0000 (18:00 +0000)
Without this CL, one of the TestDebugCall tests would fail 1% to 2% of
the time on the android-amd64-emu gomote. With this CL, I ran the
tests for 1000 iterations with no failures.

Fixes #32985

Change-Id: I541268a2a0c10d0cd7604f0b2dbd15c1d18e5730
Reviewed-on: https://go-review.googlesource.com/c/go/+/205248
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/runtime/export_debug_test.go

index e97dd52f209d9f0e46a16b0f9851c4df7629c643..7deddd52ea9719c5d9a102f4f2846eabf009c1f6 100644 (file)
@@ -67,6 +67,7 @@ func InjectDebugCall(gp *g, fn, args interface{}, tkill func(tid int) error) (in
                        case "retry _Grunnable", "executing on Go runtime stack":
                                // These are transient states. Try to get out of them.
                                if i < 100 {
+                                       usleep(100)
                                        Gosched()
                                        continue
                                }