"Reply channel not set up yet" when 2 HTTP Citrus actions happen in parallel
See original GitHub issueCitrus Version 2.7.8
Expected behavior Test passes
Actual behavior Test fails
Test case description 2 logically identical async blocks with different test data, pseudo code:
async().actions(
insert data 1 into DB,
behaviour with HTTP receive() and respond() with HTTP 200 OK,
DB check that a record with status "SUCCESS" exists for the test data 1
);
async().actions(
insert data 2 into DB,
behaviour with HTTP receive() and respond() with HTTP 200 OK,
DB check that a record with status "SUCCESS" exists for the test data 2
);
SUT behavior:
- SUT has a background job which is triggered every 5 sec (on TEST env)
- The background job scans DB for new entries and starts processing them
- SUT then does HTTP POST with this new data as payload to an external system (Citrus HTTP mock server)
- The external system responds with some additional data (the mock replies with HTTP 200 OK)
- When SUT receives this data, the processing is finished and SUT then stores a record with status SUCCESS into DB (Citrus checks that DB has this entry at the end of the
async
blocks)
Note: one async
block alone works but 2 blocks cause a failure:
12:57:06,068 DEBUG on.DefaultCorrelationManager| Finding correlated object for 'citrus_message_id = '9a369286-4824-4d6c-9eac-0bb12308d19a''
12:57:06,068 DEBUG citrus.RetryLogger| Reply channel not set up yet - retrying in 500ms
It seems that Citrus cannot find the right HTTP channel for sending a response.
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (20 by maintainers)
Top Results From Across the Web
Citrus fails to find reply channel when receiving & sending ...
The parallel container causes the problems here. But you can safely remove the parallel container when using selectors in receive actions.
Read more >Changes 2.0 | Citrus Reference Guide - Citrus Framework
Reply message correlation In synchronous communication scenarios Citrus optionally correlated messages across send and receive test actions. In default setting ...
Read more >Supervised Machine Learning with CITRUS for Single Cell ...
CITRUS is a supervised machine learning algorithm designed to analyze single cell data, identify cell populations, and identify changes in the frequencies ...
Read more >10 Safety - City of Citrus Heights
established the program in 1977 (Public Law 95-124) as a long-term, ... Although no active faults are located in the immediate vicinity of...
Read more >Citrus Framework - Reference Documentation
takes place to a later time when all test actions are setup and the test case is ... software stability not only on...
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 Free
Top 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
Hi @svettwer !
I had some spare time to implement a super-duper-small example SUT and a couple of Citrus tests which reproduce this bug: https://github.com/progaddict/citrus-multiple-async-blocks
I hope this will help you guys to fixie-wixie the bug super-duper-fast 😆
Thx to @progaddict and his SUT project, I was able to shrink the context of the issue a little bit further.
TL;DR It seems that multiple
async
container disturb each other in some way. It might be a race condition or a message overwriting in the message channel depending on the order the messages arrive.Details I’ve created the following test cases:
with the config:
The sample project configured the endpoints differently, with a higher timeout than the
async
container comes with. That’s why the error message is misleading and the endpoint is polling much longer as the container runs. This is especially important for #548.I’ve reduced the high timeouts which leads to a different, more test action specific error message.
At the end, it seems like the multiple
async
container disturb each other. If you execute the failing test multiple times, you’ll notice that the issue occurs sometimes forfoo
and sometimes forboo
. This could indicate a race condition or a message overwriting in the message channel depending on the order the messages arrive.BR, Sven