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

Fix potential flakiness in TestIDService #945

Merged
merged 1 commit into from May 20, 2020
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
10 changes: 5 additions & 5 deletions p2p/protocol/identify/id_test.go
Expand Up @@ -49,6 +49,11 @@ func subtestIDService(t *testing.T) {
defer ids1.Close()
defer ids2.Close()

sub, err := ids1.Host.EventBus().Subscribe(new(event.EvtPeerIdentificationCompleted), eventbus.BufSize(16))
if err != nil {
t.Fatal(err)
}

testKnowsAddrs(t, h1, h2p, []ma.Multiaddr{}) // nothing
testKnowsAddrs(t, h2, h1p, []ma.Multiaddr{}) // nothing

Expand All @@ -70,11 +75,6 @@ func subtestIDService(t *testing.T) {
t.Fatal("should have a conn here")
}

sub, err := ids1.Host.EventBus().Subscribe(new(event.EvtPeerIdentificationCompleted), eventbus.BufSize(16))
if err != nil {
t.Fatal(err)
}

ids1.IdentifyConn(h1t2c[0])

// the IDService should be opened automatically, by the network.
Expand Down