gnodet commented on code in PR #23180:
URL: https://github.com/apache/camel/pull/23180#discussion_r3232681759
##########
core/camel-core/src/test/java/org/apache/camel/impl/TwoRouteSuspendResumeTest.java:
##########
@@ -49,16 +49,10 @@ public void testSuspendResume() throws Exception {
context.getRouteController().suspendRoute("foo");
- // need to give seda consumer thread time to idle
- await().atMost(1, TimeUnit.SECONDS).until(() -> {
- return context.getEndpoint("seda:foo",
SedaEndpoint.class).getQueue().isEmpty();
- });
-
- // even though we wait for the queues to empty, there is a race
condition where the consumer
- // may still process messages while it's being suspended due to
asynchronous message handling.
- // as a result, we need to wait a bit longer to ensure that the seda
consumer is suspended before
- // sending the next message.
- Thread.sleep(1000L);
Review Comment:
What about the `pollDelay(1, TimeUnit.SECONDS)` ?
--
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]