add test for new conn manager flags

pull/4377/head
“GheisMohammadi” 2 years ago committed by Casey Gardiner
parent d46aaf59d4
commit 047d10461d
  1. 30
      cmd/harmony/flags_test.go

@ -440,6 +440,36 @@ func TestP2PFlags(t *testing.T) {
WaitForEachPeerToConnect: false,
},
},
{
args: []string{"--p2p.connmgr-low", "100"},
expConfig: harmonyconfig.P2pConfig{
Port: nodeconfig.DefaultP2PPort,
IP: nodeconfig.DefaultPublicListenIP,
KeyFile: "./.hmykey",
DiscConcurrency: nodeconfig.DefaultP2PConcurrency,
MaxConnsPerIP: nodeconfig.DefaultMaxConnPerIP,
DisablePrivateIPScan: defaultConfig.P2P.DisablePrivateIPScan,
MaxPeers: defaultConfig.P2P.MaxPeers,
ConnManagerLowWatermark: 100,
ConnManagerHighWatermark: defaultConfig.P2P.ConnManagerHighWatermark,
WaitForEachPeerToConnect: false,
},
},
{
args: []string{"--p2p.connmgr-high", "400"},
expConfig: harmonyconfig.P2pConfig{
Port: nodeconfig.DefaultP2PPort,
IP: nodeconfig.DefaultPublicListenIP,
KeyFile: "./.hmykey",
DiscConcurrency: nodeconfig.DefaultP2PConcurrency,
MaxConnsPerIP: nodeconfig.DefaultMaxConnPerIP,
DisablePrivateIPScan: defaultConfig.P2P.DisablePrivateIPScan,
MaxPeers: defaultConfig.P2P.MaxPeers,
ConnManagerLowWatermark: defaultConfig.P2P.ConnManagerLowWatermark,
ConnManagerHighWatermark: 400,
WaitForEachPeerToConnect: false,
},
},
}
for i, test := range tests {
ts := newFlagTestSuite(t, append(p2pFlags, legacyMiscFlags...),

Loading…
Cancel
Save