1
0
mirror of https://github.com/golang/go synced 2024-11-26 11:48:03 -07:00

context: fix XTestInterlockedCancels

The test does not use Done channel, so fix that.

Change-Id: I795feab2e95de815b8b6ee7a7fd90f19f7af7db1
Reviewed-on: https://go-review.googlesource.com/c/go/+/294749
Reviewed-by: Sameer Ajmani <sameer@golang.org>
Trust: Sameer Ajmani <sameer@golang.org>
Trust: Cody Oss <codyoss@google.com>
Run-TryBot: Sameer Ajmani <sameer@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Keiichi Hirobe 2021-02-21 12:22:13 +09:00 committed by Sameer Ajmani
parent aaed6cbced
commit 42b9e3a8df

View File

@ -525,7 +525,7 @@ func XTestInterlockedCancels(t testingT) {
parent, cancelParent := WithCancel(Background())
child, cancelChild := WithCancel(parent)
go func() {
parent.Done()
<-parent.Done()
cancelChild()
}()
cancelParent()