From: Ian Lance Taylor Date: Wed, 26 Jan 2011 23:51:04 +0000 (-0800) Subject: netchan: Avoid race condition in test. X-Git-Tag: weekly.2011-02-01~68 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9a9c156a004e1fcfc636415c343d3f50318122b4;p=gostls13.git 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 --- diff --git a/src/pkg/netchan/netchan_test.go b/src/pkg/netchan/netchan_test.go index 2134297c40..6d7d63f988 100644 --- a/src/pkg/netchan/netchan_test.go +++ b/src/pkg/netchan/netchan_test.go @@ -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.