mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: add PAUSE, CONT output lines to explain Parallel execution
This should make parallel execution a bit clearer. With -p=1 it should make the execution completely unambiguous. Fixes #19280. Change-Id: Ib48cdfe96896d01b0d8f98ccb2fab614407a7d92 Reviewed-on: https://go-review.googlesource.com/49430 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f14f7b3141
commit
3a8b9cfe91
1 changed files with 21 additions and 0 deletions
|
|
@ -675,9 +675,30 @@ func (t *T) Parallel() {
|
||||||
t.parent.sub = append(t.parent.sub, t)
|
t.parent.sub = append(t.parent.sub, t)
|
||||||
t.raceErrors += race.Errors()
|
t.raceErrors += race.Errors()
|
||||||
|
|
||||||
|
if t.chatty {
|
||||||
|
// Print directly to root's io.Writer so there is no delay.
|
||||||
|
root := t.parent
|
||||||
|
for ; root.parent != nil; root = root.parent {
|
||||||
|
}
|
||||||
|
root.mu.Lock()
|
||||||
|
fmt.Fprintf(root.w, "=== PAUSE %s\n", t.name)
|
||||||
|
root.mu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
t.signal <- true // Release calling test.
|
t.signal <- true // Release calling test.
|
||||||
<-t.parent.barrier // Wait for the parent test to complete.
|
<-t.parent.barrier // Wait for the parent test to complete.
|
||||||
t.context.waitParallel()
|
t.context.waitParallel()
|
||||||
|
|
||||||
|
if t.chatty {
|
||||||
|
// Print directly to root's io.Writer so there is no delay.
|
||||||
|
root := t.parent
|
||||||
|
for ; root.parent != nil; root = root.parent {
|
||||||
|
}
|
||||||
|
root.mu.Lock()
|
||||||
|
fmt.Fprintf(root.w, "=== CONT %s\n", t.name)
|
||||||
|
root.mu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
t.start = time.Now()
|
t.start = time.Now()
|
||||||
t.raceErrors += -race.Errors()
|
t.raceErrors += -race.Errors()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue