Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
e77e4b13
Commit
e77e4b13
authored
Jan 20, 2015
by
Juan Batiz-Benet
Browse files
p2p/test/reconnect: fixed race condition
parent
6012b867
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/reconnects/reconnect_test.go
View file @
e77e4b13
...
...
@@ -188,16 +188,16 @@ func SubtestConnSendDisc(t *testing.T, hosts []host.Host) {
defer
wg
.
Done
()
go
sF
(
s
)
log
.
Debugf
(
"getting handle %d"
,
i
)
log
.
Debugf
(
"getting handle %d"
,
j
)
sc
:=
<-
ss
// wait to get handle.
log
.
Debugf
(
"spawning worker %d"
,
i
)
log
.
Debugf
(
"spawning worker %d"
,
j
)
for
i
:=
0
;
i
<
numMsgs
;
i
++
{
for
k
:=
0
;
k
<
numMsgs
;
k
++
{
sc
.
send
<-
struct
{}{}
<-
sc
.
sent
log
.
Debugf
(
"%d sent %d"
,
j
,
i
)
log
.
Debugf
(
"%d sent %d"
,
j
,
k
)
<-
sc
.
read
log
.
Debugf
(
"%d read %d"
,
j
,
i
)
log
.
Debugf
(
"%d read %d"
,
j
,
k
)
}
sc
.
close_
<-
struct
{}{}
<-
sc
.
closed
...
...
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