diff options
Diffstat (limited to 'pkg/server/server_test.go')
-rw-r--r-- | pkg/server/server_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index e56c6302..f1809e26 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -115,6 +115,7 @@ func TestListPolicyAssignment(t *testing.T) { }, }) assert.Nil(err) + defer s.StopBgp(context.Background(), &api.StopBgpRequest{}) for i := 1; i < 4; i++ { addr := fmt.Sprintf("127.0.0.%d", i) @@ -211,6 +212,11 @@ func TestMonitor(test *testing.T) { RemotePort: 10179, }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 10, + }, + }, } err = t.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(m)}) assert.Nil(err) @@ -344,6 +350,11 @@ func TestNumGoroutineWithAddDeleteNeighbor(t *testing.T) { // wait goroutines to finish (e.g. internal goroutine for // InfiniteChannel) time.Sleep(time.Second * 5) + for i := 0; i < 5; i++ { + if num == runtime.NumGoroutine() { + return + } + } assert.Equal(num, runtime.NumGoroutine()) } @@ -580,6 +591,11 @@ func TestPeerGroup(test *testing.T) { RemotePort: 10179, }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 10, + }, + }, } err = t.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(m)}) assert.Nil(err) @@ -647,6 +663,11 @@ func TestDynamicNeighbor(t *testing.T) { RemotePort: 10179, }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 10, + }, + }, } err = s2.AddPeer(context.Background(), &api.AddPeerRequest{Peer: NewPeerFromConfigStruct(m)}) @@ -722,6 +743,11 @@ func TestGracefulRestartTimerExpired(t *testing.T) { RestartTime: 1, }, }, + Timers: config.Timers{ + Config: config.TimersConfig{ + ConnectRetry: 10, + }, + }, } err = s2.addNeighbor(m) assert.Nil(err) |