From 4975f0abe5d8f157b3f11017a155a092e4477e2a Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 25 Sep 2021 14:07:52 +0100 Subject: [PATCH] remove dependency on github.com/ipfs/go-detect-race --- examples/pubsub/chat/go.sum | 1 - go.mod | 1 - p2p/net/mock/mock_test.go | 6 +++--- p2p/protocol/identify/id_test.go | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/pubsub/chat/go.sum b/examples/pubsub/chat/go.sum index a336faf6..685778e8 100644 --- a/examples/pubsub/chat/go.sum +++ b/examples/pubsub/chat/go.sum @@ -324,7 +324,6 @@ github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13X github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= github.com/ipfs/go-datastore v0.4.6/go.mod h1:XSipLSc64rFKSFRFGo1ecQl+WhYce3K7frtpHkyPFUc= -github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.2.7/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= diff --git a/go.mod b/go.mod index 007eb6dd..19ccf737 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/huin/goupnp v1.0.2 // indirect github.com/ipfs/go-cid v0.0.7 github.com/ipfs/go-datastore v0.4.6 - github.com/ipfs/go-detect-race v0.0.1 github.com/ipfs/go-ipfs-util v0.0.2 github.com/ipfs/go-log/v2 v2.3.0 github.com/jbenet/goprocess v0.1.4 diff --git a/p2p/net/mock/mock_test.go b/p2p/net/mock/mock_test.go index a857d65e..f74e9886 100644 --- a/p2p/net/mock/mock_test.go +++ b/p2p/net/mock/mock_test.go @@ -11,12 +11,12 @@ import ( "testing" "time" - detectrace "github.com/ipfs/go-detect-race" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" "github.com/libp2p/go-libp2p-testing/ci" tnet "github.com/libp2p/go-libp2p-testing/net" + "github.com/libp2p/go-libp2p-testing/race" ) func TestNetworkSetup(t *testing.T) { @@ -358,7 +358,7 @@ func makePonger(t *testing.T, st string, errs chan<- error) func(network.Stream) func TestStreamsStress(t *testing.T) { ctx := context.Background() nnodes := 100 - if detectrace.WithRace() { + if race.WithRace() { nnodes = 30 } @@ -594,7 +594,7 @@ func TestLimitedStreams(t *testing.T) { } func TestFuzzManyPeers(t *testing.T) { peerCount := 500 - if detectrace.WithRace() { + if race.WithRace() { peerCount = 100 } for i := 0; i < peerCount; i++ { diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index e25af293..8218c7b6 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -9,7 +9,6 @@ import ( "testing" "time" - detectrace "github.com/ipfs/go-detect-race" ic "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/event" "github.com/libp2p/go-libp2p-core/host" @@ -19,6 +18,7 @@ import ( "github.com/libp2p/go-libp2p-core/protocol" "github.com/libp2p/go-libp2p-core/record" coretest "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p-testing/race" "github.com/libp2p/go-eventbus" "github.com/libp2p/go-libp2p" @@ -268,7 +268,7 @@ func emitAddrChangeEvt(t *testing.T, h host.Host) { // id service is done. func TestIDService(t *testing.T) { // This test is highly timing dependent, waiting on timeouts/expiration. - if detectrace.WithRace() { + if race.WithRace() { t.Skip("skipping highly timing dependent test when race detector is enabled") } oldTTL := peerstore.RecentlyConnectedAddrTTL