diff --git a/derp/derp_test.go b/derp/derp_test.go index c94c36217..7219d762e 100644 --- a/derp/derp_test.go +++ b/derp/derp_test.go @@ -403,8 +403,11 @@ func TestSendFreeze(t *testing.T) { t.Logf("TEST COMPLETE, cancelling sender") cancel() t.Logf("closing connections") - aliceConn.Close() + // Close bob before alice. + // Starting with alice can cause a PeerGoneMessage to reach + // bob before bob is closed, causing a test flake (issue 2668). bobConn.Close() + aliceConn.Close() cathyConn.Close() for i := 0; i < cap(errCh); i++ {