Cleans up based on review feedback.

This commit is contained in:
James Phillips 2017-03-20 16:23:40 -07:00
parent 5dd60581f1
commit e91377fa26
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
2 changed files with 17 additions and 31 deletions

View File

@ -16,10 +16,10 @@ type Area struct {
// when creating a new area. // when creating a new area.
ID string ID string
// PeeerDatacenter is the peer Consul datacenter that will make up the // PeerDatacenter is the peer Consul datacenter that will make up the
// other side of this network area. Network areas always involve a pair // other side of this network area. Network areas always involve a pair
// of datacenters: the datacenter where the area was created, and the // of datacenters: the datacenter where the area was created, and the
// peer datacenter. This is required // peer datacenter. This is required.
PeerDatacenter string PeerDatacenter string
// RetryJoin specifies the address of Consul servers to join to, such as // RetryJoin specifies the address of Consul servers to join to, such as
@ -37,7 +37,7 @@ type AreaJoinResponse struct {
Joined bool Joined bool
// If we couldn't join, this is the message with information. // If we couldn't join, this is the message with information.
What string Error string
} }
// SerfMember is a generic structure for reporting information about members in // SerfMember is a generic structure for reporting information about members in

View File

@ -241,17 +241,13 @@ func TestServer_JoinWAN_Flood(t *testing.T) {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
testutil.WaitForResult(func() (bool, error) { for i, s := range []*Server{s1, s2} {
return len(s1.WANMembers()) == 2, nil testutil.WaitForResult(func() (bool, error) {
}, func(err error) { return len(s.WANMembers()) == 2, nil
t.Fatalf("bad len") }, func(err error) {
}) t.Fatalf("bad len for server %d", i)
})
testutil.WaitForResult(func() (bool, error) { }
return len(s2.WANMembers()) == 2, nil
}, func(err error) {
t.Fatalf("bad len")
})
dir3, s3 := testServer(t) dir3, s3 := testServer(t)
defer os.RemoveAll(dir3) defer os.RemoveAll(dir3)
@ -265,23 +261,13 @@ func TestServer_JoinWAN_Flood(t *testing.T) {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
testutil.WaitForResult(func() (bool, error) { for i, s := range []*Server{s1, s2, s3} {
return len(s1.WANMembers()) == 3, nil testutil.WaitForResult(func() (bool, error) {
}, func(err error) { return len(s.WANMembers()) == 3, nil
t.Fatalf("bad len") }, func(err error) {
}) t.Fatalf("bad len for server %d", i)
})
testutil.WaitForResult(func() (bool, error) { }
return len(s2.WANMembers()) == 3, nil
}, func(err error) {
t.Fatalf("bad len")
})
testutil.WaitForResult(func() (bool, error) {
return len(s3.WANMembers()) == 3, nil
}, func(err error) {
t.Fatalf("bad len")
})
} }
func TestServer_JoinSeparateLanAndWanAddresses(t *testing.T) { func TestServer_JoinSeparateLanAndWanAddresses(t *testing.T) {