Skip to content

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

@petersilva

Description

@petersilva

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions