1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:30:25 -07:00

netchan: Avoid race condition in test.

Make sure we export the channels before we try to import
them.

R=r
CC=golang-dev
https://golang.org/cl/4077046
This commit is contained in:
Ian Lance Taylor 2011-01-26 15:51:04 -08:00
parent f626696d21
commit 9a9c156a00

View File

@ -395,7 +395,7 @@ func TestCrossConnect(t *testing.T) {
t.Fatal("new importer:", err)
}
go crossExport(e1, e2, t)
crossExport(e1, e2, t)
crossImport(i1, i2, t)
}
@ -413,7 +413,7 @@ func crossExport(e1, e2 *Exporter, t *testing.T) {
t.Fatal("exportReceive:", err)
}
crossLoop("export", s, r, t)
go crossLoop("export", s, r, t)
}
// Import side of cross-traffic.