Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #296 from ipfs/fix/test-TestRateLimitingRequests
Browse files Browse the repository at this point in the history
fix flaky TestRateLimitingRequests
  • Loading branch information
Stebalien authored Mar 12, 2020
2 parents df360b3 + 0945c26 commit 12021fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/providerquerymanager/providerquerymanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestRateLimitingRequests(t *testing.T) {
peers := testutil.GeneratePeers(10)
fpn := &fakeProviderNetwork{
peersFound: peers,
delay: 1 * time.Millisecond,
delay: 5 * time.Millisecond,
}
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
Expand All @@ -268,7 +268,7 @@ func TestRateLimitingRequests(t *testing.T) {
for i := 0; i < maxInProcessRequests+1; i++ {
requestChannels = append(requestChannels, providerQueryManager.FindProvidersAsync(sessionCtx, keys[i]))
}
time.Sleep(9 * time.Millisecond)
time.Sleep(20 * time.Millisecond)
fpn.queriesMadeMutex.Lock()
if fpn.liveQueries != maxInProcessRequests {
t.Logf("Queries made: %d\n", fpn.liveQueries)
Expand Down

0 comments on commit 12021fa

Please sign in to comment.