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
94b505a6
Unverified
Commit
94b505a6
authored
May 20, 2019
by
Michael Avila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup timing; Unset ProviderSearchDelay at test exit
parent
0bae16c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
bitswap_test.go
bitswap_test.go
+3
-4
No files found.
bitswap_test.go
View file @
94b505a6
...
...
@@ -102,7 +102,8 @@ func TestGetBlockFromPeerAfterPeerAnnounces(t *testing.T) {
}
func
TestDoesNotProvideWhenConfiguredNotTo
(
t
*
testing
.
T
)
{
bssession
.
SetProviderSearchDelay
(
10
*
time
.
Millisecond
)
bssession
.
SetProviderSearchDelay
(
50
*
time
.
Millisecond
)
defer
bssession
.
SetProviderSearchDelay
(
time
.
Second
)
net
:=
tn
.
VirtualNetwork
(
mockrouting
.
NewServer
(),
delay
.
Fixed
(
kNetworkDelay
))
block
:=
blocks
.
NewBlock
([]
byte
(
"block"
))
ig
:=
testinstance
.
NewTestInstanceGenerator
(
net
,
bitswap
.
ProvideEnabled
(
false
))
...
...
@@ -118,12 +119,10 @@ func TestDoesNotProvideWhenConfiguredNotTo(t *testing.T) {
t
.
Fatal
(
err
)
}
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
0
*
time
.
Millisecond
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
6
0
*
time
.
Millisecond
)
defer
cancel
()
ns
:=
wantsBlock
.
Exchange
.
NewSession
(
ctx
)
.
(
*
bssession
.
Session
)
// set find providers delay to less than timeout context of this test
ns
.
SetBaseTickDelay
(
10
*
time
.
Millisecond
)
received
,
err
:=
ns
.
GetBlock
(
ctx
,
block
.
Cid
())
if
received
!=
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