Browse Source

pstoremanager: fix flaky TestClose (#1649)

pull/1576/head
Marten Seemann 2 years ago
committed by GitHub
parent
commit
eb77ba41e9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      p2p/host/pstoremanager/pstoremanager_test.go

2
p2p/host/pstoremanager/pstoremanager_test.go

@ -74,7 +74,6 @@ func TestReconnect(t *testing.T) {
}
func TestClose(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)
defer ctrl.Finish()
eventBus := eventbus.NewBus()
@ -98,6 +97,7 @@ func TestClose(t *testing.T) {
// make sure the event is sent before we close
select {
case <-sub.Out():
time.Sleep(100 * time.Millisecond) // make sure this event is also picked up by the pstoremanager
case <-time.After(5 * time.Second):
t.Fatalf("Hit timeout")
}

Loading…
Cancel
Save