Runing http call in parallel and can't receive all, Action timeout exception
See original GitHub issueCitrus Version 2.7.6
Question How to properly setup parallel test action that makes http calls and validate responses ?
What I’ve tried so far
parallel().actions(
sendAction(),
sendAction(),
...
sendAction()
);
parallel().actions(
receiveAction(),
receiveAction(),
...
receiveAction()
);
And even tried as below:
parallel().actions(
sequential.actions(
sendAction(),
receiveAction()
),
...
sequential.actions(
sendAction(),
receiveAction()
)
);
where sendAction()
is simply as below:
return http(x -> x.client(httpClient)
.send()
.post()
.contentType(ContentType.APPLICATION_XML.getMimeType())
.header("Authorization", "Basic citrus:encodeBase64('${user}:${pass}')")
.payload(...)
receiveAction()
is:
return http(x -> x.client(httpClient)
.receive()
.response(HttpStatus.OK)
.validationCallback((m, c) -> {
System.out.println(m.getPayload(String.class));
}));
Additional information Unfortunately, it failed with timeout exception usually at 2nd or 3rd receiveAction() method call.
com.consol.citrus.exceptions.TestCaseFailedException: Action timeout while receiving synchronous reply message from http server
Running in synchronous way as below is working totally fine. But we need to run those calls in parallel.
sendAction();
receiveAction();
...
sendAction();
receiveAction();
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
node.js - Parallel executing NodeJS request causes timeout
You are setting an agressive timeout, so it makes sense that the requests are timing out. The longer I made the timeout, the...
Read more >9. Cancellation and Timeouts - Parallel and Concurrent ...
The ThreadId is a value returned by a previous call to forkIO , and may refer to a thread in any state: running,...
Read more >Handle HTTP request failures in Power Automate
Take actions based on HTTP status code: The quick way to do this is get the HTTP status code of the HTTP request...
Read more >How to avoid the timeout error in Rest API request
Solved: Hi All, When i am running the Rest API its getting below error, but its working fine in the Postman. Please help...
Read more >Hi All,parallely i am sending the say some 10 requests to ...
you are getting the time out issue, because the server not able to responded the given time, so your HTTP Requester as Client...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi!
I knew there was a better way to solve this but I couldn’t remember instantaneously.
You could apply selectors to identify the messages by their
citrus_message_id
. This is still a manual mapping. I’ll open an enhancement issue so that citrus is able to handle those situations out of the box.BR, Sven
Hi!
Unfortunately I can’t provide a schedule for #459 currently but it’s good to hear that the suggested solution worked for you as well.
BR, Sven