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-unixfs
Commits
670b2b59
Commit
670b2b59
authored
Jan 13, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/net/swarm: fix racey test
parent
102c43a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
p2p/net/swarm/swarm_addr_test.go
p2p/net/swarm/swarm_addr_test.go
+4
-8
No files found.
p2p/net/swarm/swarm_addr_test.go
View file @
670b2b59
...
...
@@ -26,13 +26,13 @@ func TestFilterAddrs(t *testing.T) {
m
(
"/ip4/1.2.3.4/udp/1234/sctp/1234"
),
// not in manet
m
(
"/ip4/1.2.3.4/udp/1234/utp"
),
// utp is broken
m
(
"/ip4/1.2.3.4/udp/1234/udt"
),
// udt is broken on arm
m
(
"/ip6/fe80::1/tcp/
1234"
),
// link local
m
(
"/ip6/fe80::1/tcp/
0"
),
// link local
m
(
"/ip6/fe80::100/tcp/1234"
),
// link local
}
good
:=
[]
ma
.
Multiaddr
{
m
(
"/ip4/127.0.0.1/tcp/
1234
"
),
m
(
"/ip6/::1/tcp/
1234
"
),
m
(
"/ip4/127.0.0.1/tcp/
0
"
),
m
(
"/ip6/::1/tcp/
0
"
),
}
goodAndBad
:=
append
(
good
,
bad
...
)
...
...
@@ -69,13 +69,9 @@ func TestFilterAddrs(t *testing.T) {
t
.
Fatal
(
"should have failed to create swarm"
)
}
if
_
,
err
:=
NewNetwork
(
ctx
,
good
,
id
,
ps
);
err
!=
nil
{
if
_
,
err
:=
NewNetwork
(
ctx
,
good
AndBad
,
id
,
ps
);
err
!=
nil
{
t
.
Fatal
(
"should have succeeded in creating swarm"
,
err
)
}
if
_
,
err
:=
NewNetwork
(
ctx
,
goodAndBad
,
id
,
ps
);
err
==
nil
{
t
.
Fatal
(
"should have failed to create swarm"
)
}
}
func
subtestAddrsEqual
(
t
*
testing
.
T
,
a
,
b
[]
ma
.
Multiaddr
)
{
...
...
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