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-dms3
Commits
fd2875f2
Commit
fd2875f2
authored
Dec 23, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing race in swarm
parent
32589ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
net/swarm/swarm_test.go
net/swarm/swarm_test.go
+12
-6
No files found.
net/swarm/swarm_test.go
View file @
fd2875f2
...
...
@@ -248,15 +248,21 @@ func TestConnHandler(t *testing.T) {
<-
time
.
After
(
time
.
Millisecond
)
// should've gotten 5 by now.
close
(
gotconn
)
swarms
[
0
]
.
SetConnHandler
(
nil
)
expect
:=
4
actual
:=
0
for
_
=
range
gotconn
{
actual
++
for
i
:=
0
;
i
<
expect
;
i
++
{
select
{
case
<-
time
.
After
(
time
.
Second
)
:
t
.
Fatal
(
"failed to get connections"
)
case
<-
gotconn
:
}
}
if
actual
!=
expect
{
t
.
Fatal
(
"should have connected to %d swarms. got: %d"
,
actual
,
expect
)
select
{
case
<-
gotconn
:
t
.
Fatalf
(
"should have connected to %d swarms"
,
expect
)
default
:
}
}
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