davsclaus commented on code in PR #30498:
URL: https://github.com/apache/camel/pull/30498#discussion_r4646348372
##########
components/camel-jetty/src/test/java/org/apache/camel/component/jetty/async/JettyAsyncContinuationTimeoutTest.java:
##########
@@ -39,21 +37,15 @@ public class JettyAsyncContinuationTimeoutTest extends
BaseJettyTest {
public void testJettyAsyncTimeout() throws Exception {
getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
- StopWatch watch = new StopWatch();
CamelExecutionException e = assertThrows(CamelExecutionException.class,
() ->
template.requestBody("http://localhost:{{port}}/myservice", null, String.class),
"Should have thrown an exception");
LOG.info("Timeout hit and client got reply with failure status code");
- long taken = watch.taken();
-
HttpOperationFailedException cause =
assertIsInstanceOf(HttpOperationFailedException.class, e.getCause());
assertEquals(504, cause.getStatusCode());
- // should be approx 3-4 sec.
- assertTrue(taken < 4500, "Timeout should occur faster than " + taken);
-
MockEndpoint.assertIsSatisfied(context);
Review Comment:
The default `assertIsSatisfied(context)` waits up to 10 s from the moment it
is called, which is after the 504 has arrived (~3 s in). The 6 s backend task
therefore finishes about 3 s into a 10 s window, a ~7 s margin, so the default
overload is enough. Resolving.
_Claude Code on behalf of davsclaus_
--
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]