• 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
..
Makefile Loading commit data...
common.go Loading commit data...
export.go Loading commit data...
import.go Loading commit data...
netchan_test.go Loading commit data...