Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flow_maint_test... one test will always fail... no appropriate queue declared for moth_api_producer. #46

Open
petersilva opened this issue Jul 15, 2024 · 0 comments

Comments

@petersilva
Copy link
Contributor

petersilva commented Jul 15, 2024

the flow_maint.sh tests in fail because the the moth_api_producer.py publishes a singe message, but there is no consumer queue waiting for it. The script checks for a message in a queue being waited for, but it is never there (because no subscriber queue is bound such that it would keep the message.) so that test always fails.

The publish works fine. It's not a problem with sr3... it's the test that is not set up to ever pass.
sample

   .024-07-15 16:01:31,052 [DEBUG] sarracenia.moth.amqp putNewMessage trying to publish body: {"pubTime": "20240715T200131.0341880322", "relPath": "sample.txt", "baseUrl": "http://host", "from_cluster": "localhost", "mode": "644", "size": 335, "mtime": "20240715T200131.0225212574", "atime": "20240715T200131.0225212574", "identity": {"method": "sha512", "value": "w5ZwUT1IMAjnQT6TLR9NSLzG5RKijhxq46FjMx5UWtsHM/FNOaYNRmGwonIPfnhE5xUORf3z5dRyI6zdL6ygNw=="}, "contentType": "text/plain"} headers: {} to xsarra under: v03.post
2024-07-15 16:01:31,052 [DEBUG] sarracenia.moth.amqp putNewMessage published body: {"pubTime": "20240715T200131.0341880322", "relPath": "sample.txt", "baseUrl": "http://host", "from_cluster": "localhost", "mode": "644", "size": 335, "mtime": "20240715T200131.0225212574", "atime": "20240715T200131.0225212574", "identity": {"method": "sha512", "value": "w5ZwUT1IMAjnQT6TLR9NSLzG5RKijhxq46FjMx5UWtsHM/FNOaYNRmGwonIPfnhE5xUORf3z5dRyI6zdL6ygNw=="}, "contentType": "text/plain"} headers: {} to xsarra under: v03.p
   .
   .
   .
test  4 FAILURE: no successful results! moth_api_producer.py should have posted 1 message

from the first message, one can see that it actually did publish the message, but the test checking the result does not see that. The way it checks is to look for messages queued using rabbitmqadmin:

posted_message_count="`rabbitmqadmin -H localhost -u bunnymaster -p ${adminpw} -f tsv list queues | awk 'BEGIN { t=0; }; ( NR > 1 ) { t+=$2; } END { print t; };'`"

printf "count of messages queued is: ${posted_message_count}\n\n"

so it's looking for all messages on the broker, yet no queue is configured such that it will get the posted message, so this test will always fail even with the code working perfectly.

petersilva added a commit that referenced this issue Jul 15, 2024
This is for issue #46. Bigger discussion there. problem is need
to declare a consumer so the queue snags the published announcement.
currently the producer works, publishing the message, but the method
used to check that needs for a queue to be bound and waiting for it.
that's missing. a bit of work to fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant