testing: add test for not exceeding maximum parallism

Fixed bug that slipped probably slipped in after rebasing and
explain why it failed on nacl/netbsd/plan9, which set default
maxparallelism to 1.

Change-Id: I4d59682fb2843d138b320334189f53fcdda5b2f6
Reviewed-on: https://go-review.googlesource.com/20980
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Marcel van Lohuizen 2016-03-18 19:11:19 +01:00
parent bea2008b83
commit 5fb6aa3e09
2 changed files with 52 additions and 1 deletions

View file

@ -602,7 +602,7 @@ type testContext struct {
func newTestContext(maxParallel int) *testContext {
return &testContext{
startParallel: make(chan bool),
maxParallel: *parallel,
maxParallel: maxParallel,
running: 1, // Set the count to 1 for the main (sequential) test.
}
}