jbonofre opened a new pull request, #2624:
URL: https://github.com/apache/activemq/pull/2624

   ### Description
   
   This PR fixes two causes of flakiness in 
`NetworkBridgeReconnectOnHandshakeFailureTest`:
   
   1. **`testBridgeReconnectsAfterHandshakeFailure` assertion race condition**:
      - In `serviceRemoteException()`, both `TimeoutException` (from the 
`collectBrokerInfos()` fallback timer) and `IOException` / `EOFException` (from 
`onException()` detecting socket close) can be called.
      - The test was using `exceptionLatch` which counted down on the *first* 
exception received (often `TimeoutException`).
      - `Wait.waitFor(() -> !remoteExceptions.isEmpty())` then unblocked 
immediately, evaluating `hasIOException` before the `EOFException` arrived on 
the transport thread.
      - Replaced with an `ioExceptionLatch` that counts down specifically when 
an `IOException` is received, ensuring we wait specifically for the expected 
`IOException` up to 10 seconds.
   
   2. **`testBridgeReconnectsAfterRemoteBrokerRestart` teardown timeout**:
      - Increased the timeout for `Wait.waitFor(() -> 
nc.activeBridges().isEmpty(), 20_000, 200)` from 10s to 20s to allow adequate 
time for bridge cleanup on busy CI nodes (as tracked in #2238).
   
   3. **Test timeout increase**:
      - Increased method `@Test(timeout = 90_000)` on both test methods to 
avoid premature timeouts in slow CI environments.
   
   Relates to #2238


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to