-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker
Milestone
Description
On go1.11, the following test silently drops a log message: https://play.golang.org/p/2gLqWOYcREv
Details
package main
import (
"os"
"testing"
)
var done = make(chan struct{})
var logged = make(chan struct{})
func TestBadness(t *testing.T) {
t.Parallel()
go func() {
defer close(logged)
<-done
t.Log("BWA ha ha ha ha!")
}()
t.Log("Hmm?")
}
func TestMain(m *testing.M) {
code := m.Run()
close(done)
<-logged
os.Exit(code)
}On go1.12beta1, as a result of https://golang.org/cl/127596 (#26720), it instead prints:
$ go1.12beta1 test
PASS
panic: Log in goroutine after has completed
goroutine 7 [running]:
testing.(*common).logDepth(0xc00009c000, 0xc0000142a0, 0x11, 0x4)
/usr/local/google/home/bcmills/sdk/go1.12beta1/src/testing/testing.go:628 +0x256
testing.(*common).logDepth(0xc00009c100, 0xc0000142a0, 0x11, 0x3)
/usr/local/google/home/bcmills/sdk/go1.12beta1/src/testing/testing.go:626 +0xa6
testing.(*common).log(...)
/usr/local/google/home/bcmills/sdk/go1.12beta1/src/testing/testing.go:614
testing.(*common).Log(0xc00009c100, 0xc00003afb8, 0x1, 0x1)
/usr/local/google/home/bcmills/sdk/go1.12beta1/src/testing/testing.go:639 +0x6a
golang.org/issue/scratch_test.TestBadness.func1(0xc00009c100)
/tmp/tmp.RMuhgfzwru/bad_test.go:16 +0xae
created by golang.org/issue/scratch_test.TestBadness
/tmp/tmp.RMuhgfzwru/bad_test.go:13 +0x51
exit status 2
FAIL golang.org/issue/scratch 0.021s
Note the lack of test name in the log message: for some reason, c.name is no longer populated at that point.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker