Skip to content

Commit

Permalink
Add error output to integration test TestGoBGPLifecycle
Browse files Browse the repository at this point in the history
The testGoBGPLifecycle gets failed occasionally, and it is not easy
to reproduce the failure manually. Adding some error output
to which the error occurs may help to resolve the issue.

Signed-off-by: Hongliang Liu <[email protected]>
  • Loading branch information
hongliangl committed Jul 18, 2024
1 parent 6e4ff87 commit c123344
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/integration/agent/gobgp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ func TestGoBGPLifecycle(t *testing.T) {
peerKeys := sets.New[string]()
peers, err := server.GetPeers(ctx)
if err != nil {
t.Logf("Failed to get peers from server: %v", err)
return nil
}
for _, peer := range peers {
if peer.SessionState != bgp.SessionEstablished {
t.Logf("Skip peer %s with session state %s", peer.Address, peer.SessionState)
continue
}
peerKeys.Insert(fmt.Sprintf("%s-%d", peer.Address, peer.ASN))
Expand Down Expand Up @@ -194,6 +196,7 @@ func TestGoBGPLifecycle(t *testing.T) {
getReceivedRoutesFn := func(server bgp.Interface, peerAddress string) []bgp.Route {
routes, err := server.GetRoutes(ctx, bgp.RouteReceived, peerAddress)
if err != nil {
t.Logf("Failed to get routes from server: %v", err)
return nil
}
return routes
Expand Down

0 comments on commit c123344

Please sign in to comment.