-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
Using Go1.7.4.
Consider the following test:
func Test(t *testing.T) {
var wg sync.WaitGroup
defer wg.Wait()
for i := 0; i < 100; i++ {
wg.Add(1)
go func(i int) {
defer wg.Done()
t.Run(fmt.Sprintf("LongLongLongLongName%d", i), func(t *testing.T) {})
}(i)
}
}On some invocations, I see something like:
=== RUN Test/LongLongLongLongName48
=== RUN Test/LongLon=== RUN Test/LongLongLongLongName50
gLongLongName49
=== RUN Test/LongLongLongLongName51
In testing.go, we directly write "=== RUN %s\n" directly to the root's io.Writer (which is os.Stdout). Although it is safe to concurrently write to os.Stdout, the results can sometimes be non-sensical.
Instead, we should acquire the root's lock before writing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.