aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/testing_issue40908.txt
blob: 4939de080c5025afdc80b0779105d8a880d90e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[short] skip
[!race] skip

go test -race testrace

-- testrace/race_test.go --
package testrace

import "testing"

func TestRace(t *testing.T) {
	helperDone := make(chan struct{})
	go func() {
		t.Logf("Something happened before cleanup.")
		close(helperDone)
	}()

	t.Cleanup(func() {
		<-helperDone
	})
}