• Ian Lance Taylor's avatar
    netchan: Fix race condition in test. · b279c048
    Ian Lance Taylor authored
    Two tests start a goroutine which runs exportSend, and then
    the tests run importReceive.  exportSend creates an export
    channel.  importReceive asks to receive values on that
    channel.  Because exportSend runs in a separate goroutine,
    it's possible for the export client to receive the request for
    values on the channel, from importReceive, before the
    goroutine actually creates the export channel.  That causes an
    error: "export: no such channel: exportedSend".  This patch
    avoids the race by creating the export channel before starting
    the goroutine.
    
    There does not seem to be a similar race condition in the
    tests which send data in the other direction.
    
    R=r
    CC=golang-dev
    https://golang.org/cl/2026045
    b279c048
Name
Last commit
Last update
bin Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
pkg Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...