Skip to content

Commit

Permalink
test: fix background test
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Dec 17, 2024
1 parent 327f9cb commit 48e1943
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cached_addr_book_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ func TestCachedAddrBook(t *testing.T) {
}

func TestBackground(t *testing.T) {
t.Skip("skipping until this test is less flaky")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

// Create a real event bus
eventBus := eventbus.NewBus()

emitter, err := eventBus.Emitter(new(event.EvtPeerIdentificationCompleted))
emitter, err := eventBus.Emitter(new(event.EvtPeerIdentificationCompleted), eventbus.Stateful)
require.NoError(t, err)

// Use a mock host with a real event bus
Expand Down Expand Up @@ -70,7 +69,7 @@ func TestBackground(t *testing.T) {
require.Eventually(t, func() bool {
_, exists := cab.peerCache.Get(testPeer)
return exists
}, time.Second*5, time.Millisecond*100, "peer was not added to cache")
}, time.Second*3, time.Millisecond*100, "peer was not added to cache")

// Verify peer state
pState, exists := cab.peerCache.Get(testPeer)
Expand Down

0 comments on commit 48e1943

Please sign in to comment.