diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-10-21 16:10:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-10-21 16:10:40 +0900 |
commit | 853944f785c2034bbf82a128b86d511e297cf221 (patch) | |
tree | 15314584a4ea6a7aa19360605bac1fe3ddf7545f /pkg/server | |
parent | 19e99002f574a06b00738e3529bae2a4869ccce9 (diff) |
server: speed up session establishment
The unittest on pkg/server finishes quicker.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server')
-rw-r--r-- | pkg/server/fsm.go | 2 | ||||
-rw-r--r-- | pkg/server/server_test.go | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/pkg/server/fsm.go b/pkg/server/fsm.go index b037c0f5..35172bd2 100644 --- a/pkg/server/fsm.go +++ b/pkg/server/fsm.go @@ -36,7 +36,7 @@ import ( ) const ( - minConnectRetryInterval = 10 + minConnectRetryInterval = 5 ) type fsmStateReasonType uint8 diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index 3cbf53a9..34e9be1f 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -335,6 +335,12 @@ func TestListPathEnableFiltered(test *testing.T) { Transport: &api.Transport{ RemotePort: 10179, }, + Timers: &api.Timers{ + Config: &api.TimersConfig{ + ConnectRetry: 1, + IdleHoldTimeAfterReset: 1, + }, + }, } ch := make(chan struct{}) go s.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) { @@ -504,6 +510,12 @@ func TestMonitor(test *testing.T) { Transport: &api.Transport{ RemotePort: 10179, }, + Timers: &api.Timers{ + Config: &api.TimersConfig{ + ConnectRetry: 1, + IdleHoldTimeAfterReset: 1, + }, + }, } ch := make(chan struct{}) go t.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) { @@ -916,6 +928,12 @@ func TestPeerGroup(test *testing.T) { RemotePort: 10179, }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 1, + IdleHoldTimeAfterReset: 1, + }, + }, } ch := make(chan struct{}) go t.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) { @@ -983,6 +1001,12 @@ func TestDynamicNeighbor(t *testing.T) { RemotePort: 10179, }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 1, + IdleHoldTimeAfterReset: 1, + }, + }, } ch := make(chan struct{}) go s2.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(peer *api.Peer) { @@ -1049,6 +1073,12 @@ func TestGracefulRestartTimerExpired(t *testing.T) { Enabled: true, RestartTime: 1, }, + Timers: &api.Timers{ + Config: &api.TimersConfig{ + ConnectRetry: 1, + IdleHoldTimeAfterReset: 1, + }, + }, } ch := make(chan struct{}) @@ -1163,6 +1193,12 @@ func peerServers(t *testing.T, ctx context.Context, servers []*BgpServer, famili RemotePort: uint16(peer.bgpConfig.Global.Config.Port), }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 1, + IdleHoldTimeAfterReset: 1, + }, + }, } // first server to get neighbor config is passive to hopefully make handshake faster |