Skip to content

Commit

Permalink
remove slow ObservedAddrManager test that doesn't test anything
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 18, 2021
1 parent 4239830 commit 2603aac
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions p2p/protocol/identify/obsaddr_test.go
Expand Up @@ -2,11 +2,9 @@ package identify_test

import (
"context"
"sync"
"testing"
"time"

detectrace "github.com/ipfs/go-detect-race"
"github.com/libp2p/go-eventbus"
"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/host"
Expand Down Expand Up @@ -248,35 +246,6 @@ func TestObsAddrSet(t *testing.T) {
}
}

func TestAddAddrsProfile(t *testing.T) {
if detectrace.WithRace() {
t.Skip("test too slow when the race detector is running")
}

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

harness := newHarness(ctx, t)

addr := ma.StringCast("/ip4/1.2.3.4/tcp/1231")
p := harness.add(ma.StringCast("/ip4/1.2.3.6/tcp/1236"))

c := harness.conn(p)
var wg sync.WaitGroup
for i := 0; i < 1000; i++ {
wg.Add(1)
go func() {
defer wg.Done()
for j := 0; j < 10000; j++ {
harness.oas.Record(c, addr)
time.Sleep(1 * time.Millisecond)
}
}()
}

wg.Wait()
}

func TestObservedAddrFiltering(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand Down

0 comments on commit 2603aac

Please sign in to comment.