Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove slow ObservedAddrManager test that doesn't test anything #1104

Merged
merged 1 commit into from May 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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