From db97616e7efb1c7c3ebc65048bc2a33764d9a35a Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 26 Aug 2023 12:08:31 +0700 Subject: [PATCH] identify: disable racy test when running with race detector --- p2p/protocol/identify/id_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index b18ba51ca5..61c7d87acc 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -107,6 +107,9 @@ func emitAddrChangeEvt(t *testing.T, h host.Host) { // this is because it used to be concurrent. Now, Dial wait till the // id service is done. func TestIDService(t *testing.T) { + if race.WithRace() { + t.Skip("This test modifies peerstore.RecentlyConnectedAddrTTL, which is racy.") + } // This test is highly timing dependent, waiting on timeouts/expiration. oldTTL := peerstore.RecentlyConnectedAddrTTL peerstore.RecentlyConnectedAddrTTL = 500 * time.Millisecond