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
9bf0f256
Unverified
Commit
9bf0f256
authored
Mar 24, 2020
by
dirkmc
Committed by
GitHub
Mar 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: flaky TestDontHaveTimeoutMgrTimeout (#320)
parent
9b89a3b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
internal/messagequeue/donthavetimeoutmgr_test.go
internal/messagequeue/donthavetimeoutmgr_test.go
+3
-3
No files found.
internal/messagequeue/donthavetimeoutmgr_test.go
View file @
9bf0f256
...
...
@@ -71,7 +71,7 @@ func (tr *timeoutRecorder) clear() {
func
TestDontHaveTimeoutMgrTimeout
(
t
*
testing
.
T
)
{
firstks
:=
testutil
.
GenerateCids
(
2
)
secondks
:=
append
(
firstks
,
testutil
.
GenerateCids
(
3
)
...
)
latency
:=
time
.
Millisecond
*
1
0
latency
:=
time
.
Millisecond
*
2
0
latMultiplier
:=
2
expProcessTime
:=
5
*
time
.
Millisecond
expectedTimeout
:=
expProcessTime
+
latency
*
time
.
Duration
(
latMultiplier
)
...
...
@@ -87,7 +87,7 @@ func TestDontHaveTimeoutMgrTimeout(t *testing.T) {
dhtm
.
AddPending
(
firstks
)
// Wait for less than the expected timeout
time
.
Sleep
(
expectedTimeout
-
5
*
time
.
Millisecond
)
time
.
Sleep
(
expectedTimeout
-
10
*
time
.
Millisecond
)
// At this stage no keys should have timed out
if
tr
.
timedOutCount
()
>
0
{
...
...
@@ -98,7 +98,7 @@ func TestDontHaveTimeoutMgrTimeout(t *testing.T) {
dhtm
.
AddPending
(
secondks
)
// Wait until after the expected timeout
time
.
Sleep
(
1
0
*
time
.
Millisecond
)
time
.
Sleep
(
2
0
*
time
.
Millisecond
)
// At this stage first set of keys should have timed out
if
tr
.
timedOutCount
()
!=
len
(
firstks
)
{
...
...
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