jbonofre commented on code in PR #1862:
URL: https://github.com/apache/activemq/pull/1862#discussion_r3011599712
##########
activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/XACompletionTest.java:
##########
@@ -249,6 +249,7 @@ public void testStatsAndBrowseAfterAckPreparedRolledback()
throws Exception {
resource.recover(XAResource.TMSTARTRSCAN);
resource.recover(XAResource.TMNOFLAGS);
+ Wait.waitFor(() -> proxy.getInFlightCount() == 0L &&
proxy.cursorSize() == 0);
Review Comment:
I suggest to wrap `Watit.waitFor()` in a `assertTrue` for better diagnostics
on failure:
```suggestion
assertTrue("Timed out waiting for inFlight and cursor to clear",
Wait.waitFor(() -> proxy.getInFlightCount() == 0L &&
proxy.cursorSize() == 0));
```
##########
activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/XACompletionTest.java:
##########
@@ -249,6 +249,7 @@ public void testStatsAndBrowseAfterAckPreparedRolledback()
throws Exception {
resource.recover(XAResource.TMSTARTRSCAN);
resource.recover(XAResource.TMNOFLAGS);
+ Wait.waitFor(() -> proxy.getInFlightCount() == 0L &&
proxy.cursorSize() == 0);
Review Comment:
The wait condition doesn't cover `getQueueSize()`. The wait checks
`getInFlightCount() == 0 && cursorSize() == 0`, but the very next assertion
also checks `getQueueSize() == 10`.
If `getQueueSize()` is also subject to async updates, it could still flake.
Worth considering whether to include it in the wait condition.
--
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