Copilot commented on code in PR #24470:
URL: https://github.com/apache/camel/pull/24470#discussion_r3530944478
##########
components/camel-lra/src/test/java/org/apache/camel/service/lra/AbstractLRATestSupport.java:
##########
@@ -59,7 +59,7 @@ public void getActiveLRAs() throws IOException,
InterruptedException {
@AfterEach
public void checkActiveLRAs() throws IOException, InterruptedException {
- await().atMost(2, SECONDS).until(() -> getNumberOfActiveLRAs(),
equalTo(activeLRAs));
+ await().atMost(20, SECONDS).until(() -> getNumberOfActiveLRAs(),
equalTo(activeLRAs));
assertEquals(activeLRAs, getNumberOfActiveLRAs(), "Some LRA have been
left pending");
Review Comment:
`checkActiveLRAs()` performs an extra HTTP call to the coordinator after
Awaitility has already observed the expected count. This adds unnecessary test
latency and can reintroduce flakiness if the coordinator’s active-LRA count
changes immediately after the await completes.
Capture the last observed value during the await and assert on that, instead
of calling `getNumberOfActiveLRAs()` a second time.
--
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]