Commit 22e08d1a authored by Rui Ueyama's avatar Rui Ueyama

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
parent 1d371a0e
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment