Skip to content

Commit

Permalink
fix racy connection comparison in TestDialWorkerLoopBasic (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored May 18, 2022
1 parent c51c1b6 commit 302321a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion p2p/net/swarm/dial_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ func TestDialWorkerLoopBasic(t *testing.T) {
t.Fatal("dial didn't complete")
}

require.Equal(t, conn, conn2)
// can't use require.Equal here, as this does a deep comparison
if conn != conn2 {
t.Fatal("expecting the same connection from both dials")
}

close(reqch)
worker.wg.Wait()
Expand Down

0 comments on commit 302321a

Please sign in to comment.