queue_processors: Avoid queue worker timeouts in tests.

For tests that use the dev server, like test-api, test-js-with-puppeteer,
we don't have the consumers for the queues. As they eventually timeout,
we get unnecessary error messages. This adds a new flag, disable_timeout,
to disable this behavior for the test cases.
This commit is contained in:
Zixuan James Li
2023-06-27 20:06:57 -04:00
committed by Tim Abbott
parent a686c0cc02
commit b6d1e56cac
3 changed files with 62 additions and 34 deletions

View File

@@ -431,10 +431,11 @@ def queue_json_publish(
elif processor:
processor(event)
else:
# The else branch is only hit during tests, where rabbitmq is not enabled.
# Must be imported here: A top section import leads to circular imports
from zerver.worker.queue_processors import get_worker
get_worker(queue_name).consume_single_event(event)
get_worker(queue_name, disable_timeout=True).consume_single_event(event)
def retry_event(