From: David du Colombier <0intro@gmail.com> Date: Tue, 13 Feb 2018 21:11:20 +0000 (+0100) Subject: runtime/trace: fix TestTraceSymbolize when GOMAXPROCS=1 X-Git-Tag: go1.11beta1~1670 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5114a7daa2f128d2de82cddb29a076d2a8e4def8;p=gostls13.git runtime/trace: fix TestTraceSymbolize when GOMAXPROCS=1 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 TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/trace/trace_stack_test.go b/src/runtime/trace/trace_stack_test.go index 0275279a6b..e7b8d57659 100644 --- a/src/runtime/trace/trace_stack_test.go +++ b/src/runtime/trace/trace_stack_test.go @@ -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()