]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime/trace: fix TestTraceSymbolize when GOMAXPROCS=1
authorDavid du Colombier <0intro@gmail.com>
Tue, 13 Feb 2018 21:11:20 +0000 (22:11 +0100)
committerDavid du Colombier <0intro@gmail.com>
Tue, 13 Feb 2018 22:55:49 +0000 (22:55 +0000)
CL 92916 added the GOMAXPROCS test in TestTraceSymbolize.

This test only succeeds when the value of GOMAXPROCS changes.

Since the test calls runtime.GOMAXPROCS(1), it will fails
on machines where GOMAXPROCS=1.

This change fixes the test by calling runtime.GOMAXPROCS(oldGoMaxProcs+1).

Fixes #23816.

Change-Id: I1183dbbd7db6077cbd7fa0754032ff32793b2195
Reviewed-on: https://go-review.googlesource.com/93735
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/trace/trace_stack_test.go

index 0275279a6b45f37d8e83010c99141f5ffa6b23f9..e7b8d5765918e68dcfe8b775b7778d382c3da11e 100644 (file)
@@ -128,7 +128,8 @@ func TestTraceSymbolize(t *testing.T) {
        wp.Write(data[:])
        <-pipeReadDone
 
-       oldGoMaxProcs := runtime.GOMAXPROCS(1)
+       oldGoMaxProcs := runtime.GOMAXPROCS(0)
+       runtime.GOMAXPROCS(oldGoMaxProcs + 1)
 
        Stop()