Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Apr 5, 2023
1 parent aa5117a commit 0bbc8f5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions p2p/host/autonat/autonat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ func TestAutoNATDialRefused(t *testing.T) {
defer hs.Close()
hc, an := makeAutoNAT(t, hs)
defer hc.Close()
defer an.Close()

// subscribe to AutoNat events
s, err := hc.EventBus().Subscribe(&event.EvtLocalReachabilityChanged{})
Expand All @@ -236,12 +235,10 @@ func TestAutoNATDialRefused(t *testing.T) {
}

connect(t, hs, hc)
expectEvent(t, s, network.ReachabilityPublic, 3*time.Second)
expectEvent(t, s, network.ReachabilityPublic, 10*time.Second)

hs.SetStreamHandler(AutoNATProto, sayRefusedStreamHandler(t))
hps := makeAutoNATRefuseDialRequest(t)
defer hps.Close()

connect(t, hps, hc)
identifyAsServer(hps, hc)

Expand Down

0 comments on commit 0bbc8f5

Please sign in to comment.