This is an automated email from the ASF dual-hosted git repository.
gnodet 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 0bb34153113f CAMEL-23901: Fix flaky
MulticastParallelStreamingTimeoutTest (#24417)
0bb34153113f is described below
commit 0bb34153113f2f16b5409b7005fca5c4618a8f63
Author: Guillaume Nodet <[email protected]>
AuthorDate: Sun Jul 5 23:02:51 2026 +0200
CAMEL-23901: Fix flaky MulticastParallelStreamingTimeoutTest (#24417)
* CAMEL-23901: Fix flaky MulticastParallelStreamingTimeoutTest
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Guillaume Nodet <[email protected]>
* CAMEL-23901: Set short resultWaitTime to avoid double-wait with Awaitility
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Guillaume Nodet <[email protected]>
---------
Signed-off-by: Guillaume Nodet <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
.../MulticastParallelStreamingTimeoutTest.java | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git
a/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStreamingTimeoutTest.java
b/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStreamingTimeoutTest.java
index 7bab3e5d46be..10e476fbf728 100644
---
a/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStreamingTimeoutTest.java
+++
b/core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStreamingTimeoutTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.camel.processor;
+import java.util.concurrent.TimeUnit;
+
import org.apache.camel.AggregationStrategy;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
@@ -23,7 +25,11 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
+import org.junit.jupiter.api.parallel.Isolated;
+
+import static org.awaitility.Awaitility.await;
+@Isolated("Short timeouts cause problems with parallel test execution")
@DisabledOnOs(architectures = { "s390x" },
disabledReason = "This test does not run reliably on s390x (see
CAMEL-21438)")
public class MulticastParallelStreamingTimeoutTest extends ContextTestSupport {
@@ -31,13 +37,19 @@ public class MulticastParallelStreamingTimeoutTest extends
ContextTestSupport {
@Test
public void testMulticastParallelStreamingTimeout() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
- // A will timeout so we only get B and C (C is faster than B)
- mock.expectedBodiesReceived("CB");
- mock.setResultWaitTime(20000);
+ // A will timeout so we only get B and C (order may vary)
+ mock.expectedMessageCount(1);
+ mock.message(0).body().not(body().contains("A"));
+ mock.message(0).body().contains("B");
+ mock.message(0).body().contains("C");
+ // Use a short result wait time so each Awaitility attempt checks
quickly
+ // without blocking (default 0 maps to 10s internally in MockEndpoint)
+ mock.setResultWaitTime(100);
template.sendBody("direct:start", "Hello");
- assertMockEndpointsSatisfied();
+ await().atMost(20, TimeUnit.SECONDS)
+ .untilAsserted(() -> assertMockEndpointsSatisfied());
}
@Override