From 047d10461dfa79b7afbf36d4ed0d67030824fdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGheisMohammadi=E2=80=9D?= <36589218+GheisMohammadi@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:33:27 +0800 Subject: [PATCH] add test for new conn manager flags --- cmd/harmony/flags_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cmd/harmony/flags_test.go b/cmd/harmony/flags_test.go index 9ebae4bb3..7f8cf34a8 100644 --- a/cmd/harmony/flags_test.go +++ b/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...),