1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:54:44 -07:00

mime/multipart: fix Writer data race test

If the process exits before the spawned goroutine
completes, it'll miss the data race.

LGTM=bradfitz
R=bradfitz
CC=dvyukov, golang-codereviews
https://golang.org/cl/122120043
This commit is contained in:
Rui Ueyama 2014-08-05 13:43:12 -07:00
parent 1d371a0ed2
commit 22e08d1a3b

View File

@ -118,8 +118,11 @@ func TestWriterBoundaryGoroutines(t *testing.T) {
// https://codereview.appspot.com/95760043/ and reverted in
// https://codereview.appspot.com/117600043/
w := NewWriter(ioutil.Discard)
done := make(chan int)
go func() {
w.CreateFormField("foo")
done <- 1
}()
w.Boundary()
<-done
}