Skip to content

Commit

Permalink
Merge pull request #945 from libp2p/feat/944
Browse files Browse the repository at this point in the history
Fix potential flakiness in TestIDService
  • Loading branch information
Stebalien authored May 20, 2020
2 parents d4d6adf + ba118a4 commit 3bf5baf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions p2p/protocol/identify/id_test.go
Original file line number Diff line number Diff line change
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

0 comments on commit 3bf5baf

Please sign in to comment.