• Daniel Martí's avatar
    cmd/go/internal/par: fix TestWorkParallel retries · b39fb9ec
    Daniel Martí authored
    When the test retried multiple times, it reused the same Work variable,
    causing in the builders being flaky due to panics. I was able to
    immediately reproduce the failure with stress and -race:
    
    	$ go test -race -c && stress -p 32 ./par.test -test.run=TestWorkParallel$
    
    	/tmp/go-stress909062277
    	--- FAIL: TestWorkParallel (0.07s)
    	panic: par.Work.Do: already called Do [recovered]
    		panic: par.Work.Do: already called Do
    
    Instead, use a new Work variable at each retry. Now, the line above
    seems to never fail. Of course, much higher 'stress -p' values will
    still result in "does not seem to be parallel" test failures since the
    machine lacks resources. But those are test failures, not panics.
    
    Fixes #26642.
    
    Change-Id: I5e962eca7602cf413d911ff5669f56d4f52da5a7
    Reviewed-on: https://go-review.googlesource.com/126355
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    Run-TryBot: Bryan C. Mills <bcmills@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
    b39fb9ec
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...