This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 06b6400c4e15 camel-mail - Fix flaky MailFetchSizeTest (#29732)
06b6400c4e15 is described below
commit 06b6400c4e15150fa535532c09854590c7f55706
Author: Aurélien Pupier <[email protected]>
AuthorDate: Thu Nov 12 21:46:00 2026 +0100
camel-mail - Fix flaky MailFetchSizeTest (#29732)
The test waited for the mailbox message count to drop with Awaitility
atMost(500 ms) once the mock endpoint was satisfied. The messages are only
flagged DELETED afterwards in MailConsumer.processCommit and removed when the
folder is closed at the end of the poll, which can take more than 500 ms on a
slow machine. Both Awaitility timeouts are raised to 10 seconds; Awaitility
returns as soon as the condition holds, so the passing test is not slower.
AI-generated by IBM Bob 2.2.1 on behalf of apupier.
Co-authored-by: IBM Bob 2.2.1
---
.../test/java/org/apache/camel/component/mail/MailFetchSizeTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
index 647a727d38f8..57139be4fe74 100644
---
a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
+++
b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
@@ -55,7 +55,7 @@ public class MailFetchSizeTest extends CamelTestSupport {
mock.setResultWaitTime(2000L);
mock.assertIsSatisfied();
- Awaitility.await().atMost(500, TimeUnit.MILLISECONDS)
+ Awaitility.await().atMost(10, TimeUnit.SECONDS)
.untilAsserted(() -> assertEquals(3,
jones.getInbox().getMessageCount()));
// reset mock to assert the next batch of 2 messages polled
@@ -66,7 +66,7 @@ public class MailFetchSizeTest extends CamelTestSupport {
mock.setResultWaitTime(3000L);
mock.assertIsSatisfied();
- Awaitility.await().atMost(500, TimeUnit.MILLISECONDS)
+ Awaitility.await().atMost(10, TimeUnit.SECONDS)
.untilAsserted(() -> assertEquals(1,
jones.getInbox().getMessageCount()));
// reset mock to assert the last message polled