]> Cypherpunks repositories - gostls13.git/commitdiff
netchan: Avoid race condition in test.
authorIan Lance Taylor <iant@golang.org>
Wed, 26 Jan 2011 23:51:04 +0000 (15:51 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 26 Jan 2011 23:51:04 +0000 (15:51 -0800)
Make sure we export the channels before we try to import
them.

R=r
CC=golang-dev
https://golang.org/cl/4077046

src/pkg/netchan/netchan_test.go

index 2134297c40b5c4038939df67bfaeaf8f056c2533..6d7d63f988240bbfe0a43425b36d583e256a913a 100644 (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.