Commit 670b2b59 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

p2p/net/swarm: fix racey test

parent 102c43a3
......@@ -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, goodAndBad, 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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment