gnodet commented on code in PR #24417:
URL: https://github.com/apache/camel/pull/24417#discussion_r3523975699
##########
core/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStreamingTimeoutTest.java:
##########
@@ -16,28 +16,37 @@
*/
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;
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 {
@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");
template.sendBody("direct:start", "Hello");
- assertMockEndpointsSatisfied();
+ await().atMost(20, TimeUnit.SECONDS)
+ .untilAsserted(() -> assertMockEndpointsSatisfied());
Review Comment:
Good catch. Fixed in 3bbfab19 — added `mock.setResultWaitTime(100)` so each
Awaitility attempt checks quickly without the internal 10s latch wait.
Awaitility now controls the full 20s timeout.
--
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]