Skip to content

Commit

Permalink
fix: flaky TestClientModeConnect (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumemichel authored Feb 7, 2025
1 parent 08074be commit 5d8d9e9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1459,9 +1459,14 @@ func TestClientModeConnect(t *testing.T) {
a.ProviderStore().AddProvider(ctx, c.Hash(), peer.AddrInfo{ID: p})
time.Sleep(time.Millisecond * 5) // just in case...

provs, err := b.FindProviders(ctx, c)
if err != nil {
t.Fatal(err)
maxRetries := 3
var provs []peer.AddrInfo
var err error
for i := 0; i < maxRetries && len(provs) == 0; i++ {
provs, err = b.FindProviders(ctx, c)
if err != nil {
t.Fatal(err)
}
}

if len(provs) == 0 {
Expand Down

0 comments on commit 5d8d9e9

Please # to comment.