Skip to content

Commit ff522b7

Browse files
committed
fix: stop router before NATS in integration test cleanup
This prevents the subscriber's ClosedCB from firing log.Fatal when NATS is stopped first, which was causing the test process to exit prematurely and leading to port binding conflicts in parallel test runs. The cleanup order is now: 1. Terminate gorouter session 2. Stop NATS server 3. Clean up test files This matches the fix from upstream PR #555 (commit b2bf830) which resolved similar issues in router/router_test.go.
1 parent c9401c6 commit ff522b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/code.cloudfoundry.org/gorouter/integration/common_integration_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ func (s *testState) StartGorouterOrFail() {
468468

469469
func (s *testState) StopAndCleanup() {
470470
// Stop router before NATS to prevent subscriber's ClosedCB from
471-
// firing log.Fatal → os.Exit(1), which kills the test proc.
471+
// firing log.Fatal → os.Exit(1), which kills the test proc
472472
if s.gorouterSession != nil && s.gorouterSession.ExitCode() == -1 {
473473
Eventually(s.gorouterSession.Terminate(), 5).Should(Exit(0))
474474
}

0 commit comments

Comments
 (0)