From 302321a46196fed7978353f23e387f86e4ac7dc5 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 18 May 2022 16:09:09 +0200 Subject: [PATCH] fix racy connection comparison in TestDialWorkerLoopBasic (#1499) --- p2p/net/swarm/dial_worker_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p2p/net/swarm/dial_worker_test.go b/p2p/net/swarm/dial_worker_test.go index c404231270..d9d2ef37a4 100644 --- a/p2p/net/swarm/dial_worker_test.go +++ b/p2p/net/swarm/dial_worker_test.go @@ -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()