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
373033e7
Commit
373033e7
authored
May 01, 2020
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: fix flaky test TestSessionBetweenPeers
parent
f005819c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
bitswap_with_sessions_test.go
bitswap_with_sessions_test.go
+7
-1
No files found.
bitswap_with_sessions_test.go
View file @
373033e7
...
...
@@ -9,10 +9,12 @@ import (
bitswap
"github.com/ipfs/go-bitswap"
bssession
"github.com/ipfs/go-bitswap/internal/session"
testinstance
"github.com/ipfs/go-bitswap/testinstance"
tn
"github.com/ipfs/go-bitswap/testnet"
blocks
"github.com/ipfs/go-block-format"
cid
"github.com/ipfs/go-cid"
blocksutil
"github.com/ipfs/go-ipfs-blocksutil"
delay
"github.com/ipfs/go-ipfs-delay"
mockrouting
"github.com/ipfs/go-ipfs-routing/mock"
tu
"github.com/libp2p/go-libp2p-testing/etc"
)
...
...
@@ -71,7 +73,7 @@ func TestSessionBetweenPeers(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
vnet
:=
get
VirtualNetwork
()
vnet
:=
tn
.
VirtualNetwork
(
mockrouting
.
NewServer
(),
delay
.
Fixed
(
time
.
Millisecond
)
)
ig
:=
testinstance
.
NewTestInstanceGenerator
(
vnet
,
nil
,
nil
)
defer
ig
.
Close
()
bgen
:=
blocksutil
.
NewBlockGenerator
()
...
...
@@ -112,6 +114,10 @@ func TestSessionBetweenPeers(t *testing.T) {
t
.
Fatal
(
err
)
}
}
// Uninvolved nodes should receive
// - initial broadcast want-have of root block
// - CANCEL (when Peer A receives the root block from Peer B)
for
_
,
is
:=
range
inst
[
2
:
]
{
stat
,
err
:=
is
.
Exchange
.
Stat
()
if
err
!=
nil
{
...
...
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