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
3be2da86
Commit
3be2da86
authored
Mar 04, 2020
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: fix flaky tests
parent
1c24de2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
internal/messagequeue/messagequeue_test.go
internal/messagequeue/messagequeue_test.go
+6
-6
internal/session/sessionwantsender_test.go
internal/session/sessionwantsender_test.go
+3
-3
No files found.
internal/messagequeue/messagequeue_test.go
View file @
3be2da86
...
...
@@ -394,9 +394,9 @@ func TestWantlistRebroadcast(t *testing.T) {
t
.
Fatal
(
"wrong number of wants"
)
}
// Tell message queue to rebroadcast after
5
ms, then wait
8
ms
messageQueue
.
SetRebroadcastInterval
(
5
*
time
.
Millisecond
)
messages
=
collectMessages
(
ctx
,
t
,
messagesSent
,
8
*
time
.
Millisecond
)
// Tell message queue to rebroadcast after
10
ms, then wait
15
ms
messageQueue
.
SetRebroadcastInterval
(
10
*
time
.
Millisecond
)
messages
=
collectMessages
(
ctx
,
t
,
messagesSent
,
15
*
time
.
Millisecond
)
firstMessage
=
messages
[
0
]
// Both original and new wants should have been rebroadcast
...
...
@@ -425,9 +425,9 @@ func TestWantlistRebroadcast(t *testing.T) {
}
}
// Tell message queue to rebroadcast after
5
ms, then wait
8
ms
messageQueue
.
SetRebroadcastInterval
(
5
*
time
.
Millisecond
)
messages
=
collectMessages
(
ctx
,
t
,
messagesSent
,
8
*
time
.
Millisecond
)
// Tell message queue to rebroadcast after
10
ms, then wait
15
ms
messageQueue
.
SetRebroadcastInterval
(
10
*
time
.
Millisecond
)
messages
=
collectMessages
(
ctx
,
t
,
messagesSent
,
15
*
time
.
Millisecond
)
firstMessage
=
messages
[
0
]
if
len
(
firstMessage
.
Wantlist
())
!=
totalWants
-
len
(
cancels
)
{
t
.
Fatal
(
"did not rebroadcast all wants"
)
...
...
internal/session/sessionwantsender_test.go
View file @
3be2da86
...
...
@@ -481,7 +481,7 @@ func TestConsecutiveDontHaveLimit(t *testing.T) {
spm
.
Update
(
p
,
[]
cid
.
Cid
{},
cids
[
:
1
],
[]
cid
.
Cid
{})
// Wait for processing to complete
time
.
Sleep
(
5
*
time
.
Millisecond
)
time
.
Sleep
(
10
*
time
.
Millisecond
)
// Peer should be available
if
has
:=
fpm
.
HasPeer
(
p
);
!
has
{
...
...
@@ -495,7 +495,7 @@ func TestConsecutiveDontHaveLimit(t *testing.T) {
}
// Wait for processing to complete
time
.
Sleep
(
5
*
time
.
Millisecond
)
time
.
Sleep
(
20
*
time
.
Millisecond
)
// Peer should be available
if
has
:=
fpm
.
HasPeer
(
p
);
!
has
{
...
...
@@ -509,7 +509,7 @@ func TestConsecutiveDontHaveLimit(t *testing.T) {
}
// Wait for processing to complete
time
.
Sleep
(
5
*
time
.
Millisecond
)
time
.
Sleep
(
20
*
time
.
Millisecond
)
// Session should remove peer
if
has
:=
fpm
.
HasPeer
(
p
);
has
{
...
...
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