SkipDuplicate -> AllowDuplicate; fix p2p test on mac

This commit is contained in:
Ethan Buchman
2018-05-30 21:44:39 -04:00
parent 432f21452d
commit d454b1b25f
5 changed files with 12 additions and 6 deletions

View File

@ -25,6 +25,7 @@ var (
func init() {
config = cfg.DefaultP2PConfig()
config.PexReactor = true
config.AllowDuplicateIP = true
}
type PeerMessage struct {
@ -180,7 +181,7 @@ func TestConnAddrFilter(t *testing.T) {
}
func TestSwitchFiltersOutItself(t *testing.T) {
s1 := MakeSwitch(config, 1, "127.0.0.2", "123.123.123", initSwitchFunc)
s1 := MakeSwitch(config, 1, "127.0.0.1", "123.123.123", initSwitchFunc)
// addr := s1.NodeInfo().NetAddress()
// // add ourselves like we do in node.go#427
@ -322,7 +323,7 @@ func TestSwitchReconnectsToPersistentPeer(t *testing.T) {
Config: DefaultPeerConfig(),
// Use different interface to prevent duplicate IP filter, this will break
// beyond two peers.
listenAddr: "127.0.0.2:0",
listenAddr: "127.0.0.1:0",
}
rp.Start()
defer rp.Stop()