Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
12021fab
Unverified
Commit
12021fab
authored
Mar 12, 2020
by
Steven Allen
Committed by
GitHub
Mar 12, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #296 from ipfs/fix/test-TestRateLimitingRequests
fix flaky TestRateLimitingRequests
parents
df360b33
0945c264
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
internal/providerquerymanager/providerquerymanager_test.go
internal/providerquerymanager/providerquerymanager_test.go
+2
-2
No files found.
internal/providerquerymanager/providerquerymanager_test.go
View file @
12021fab
...
...
@@ -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
)
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment