diff --git a/pkg/controllers/routing/network_routes_controller_test.go b/pkg/controllers/routing/network_routes_controller_test.go index 0a4fd9165a..e66d4fd37c 100644 --- a/pkg/controllers/routing/network_routes_controller_test.go +++ b/pkg/controllers/routing/network_routes_controller_test.go @@ -1523,7 +1523,11 @@ func Test_routeReflectorConfiguration(t *testing.T) { err := testcase.nrc.startBgpServer() if err == nil { - defer testcase.nrc.bgpServer.Stop() + defer func() { + if err := testcase.nrc.bgpServer.Stop(); err != nil { + t.Fatalf("failed to stop BGP server : %s", err) + } + }() } if testcase.expectedBgpToStart {