create subscriber first
@@ -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
@@ -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.
