• Daniel Martí's avatar
    testing: error if -parallel is given N<1 · 86dde2de
    Daniel Martí authored
    Otherwise, if there are any parallel tests, it will hang and panic with
    "all goroutines are asleep - deadlock!".
    
    Do not use flag.Uint to handle the error for us because we also want to
    error on N==0, and because it would make setting the default to
    GOMAXPROCS(0) more difficult, since it's an int.
    
    Check for it right after flag.Parse, and mimic flag errors by printing
    the usage and returning exit code 2.
    
    Fixes #20542.
    
    Change-Id: I0c9d4587f83d406a8f5e42ed74e40be46d639ffb
    Reviewed-on: https://go-review.googlesource.com/54150
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    86dde2de
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...