Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
77eead48
Unverified
Commit
77eead48
authored
Jun 26, 2020
by
Petar Radovic
Committed by
GitHub
Jun 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Multistream test fix (#389)
* multistream test fix
parent
f408b582
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
protocols_test.go
pkg/p2p/libp2p/protocols_test.go
+5
-3
No files found.
pkg/p2p/libp2p/protocols_test.go
View file @
77eead48
...
@@ -54,11 +54,13 @@ func TestNewStreamMulti(t *testing.T) {
...
@@ -54,11 +54,13 @@ func TestNewStreamMulti(t *testing.T) {
s1
,
overlay1
:=
newService
(
t
,
1
,
libp2p
.
Options
{})
s1
,
overlay1
:=
newService
(
t
,
1
,
libp2p
.
Options
{})
var
(
var
(
h1calls
,
h2calls
int32
h1calls
,
h2calls
int32
h1
=
func
(
_
context
.
Context
,
_
p2p
.
Peer
,
_
p2p
.
Stream
)
error
{
h1
=
func
(
_
context
.
Context
,
_
p2p
.
Peer
,
s
p2p
.
Stream
)
error
{
defer
s
.
Close
()
_
=
atomic
.
AddInt32
(
&
h1calls
,
1
)
_
=
atomic
.
AddInt32
(
&
h1calls
,
1
)
return
nil
return
nil
}
}
h2
=
func
(
_
context
.
Context
,
_
p2p
.
Peer
,
_
p2p
.
Stream
)
error
{
h2
=
func
(
_
context
.
Context
,
_
p2p
.
Peer
,
s
p2p
.
Stream
)
error
{
defer
s
.
Close
()
_
=
atomic
.
AddInt32
(
&
h2calls
,
1
)
_
=
atomic
.
AddInt32
(
&
h2calls
,
1
)
return
nil
return
nil
}
}
...
@@ -79,7 +81,7 @@ func TestNewStreamMulti(t *testing.T) {
...
@@ -79,7 +81,7 @@ func TestNewStreamMulti(t *testing.T) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
if
err
:=
stream
.
Close
();
err
!=
nil
{
if
err
:=
stream
.
Full
Close
();
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
if
atomic
.
LoadInt32
(
&
h1calls
)
!=
1
{
if
atomic
.
LoadInt32
(
&
h1calls
)
!=
1
{
...
...
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