Skip to content

Commit

Permalink
Fix tests for priority RabbitMQ implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Nov 20, 2023
1 parent f0622a3 commit 3ddfebe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ def test_task_queue(self):
conn = get_fakeredis()
collection_id = 2
task_id = "test-task"
priority = randrange(1, settings.RABBITMQ_MAX_PRIORITY + 1)
body = {
"collection_id": 2,
"job_id": "test-job",
"task_id": "test-task",
"operation": "test-op",
"context": {},
"payload": {},
"priority": priority,
}
connection = get_rabbitmq_connection()
channel = connection.channel()
channel.queue_purge(settings.QUEUE_INGEST)
priority = randrange(1, settings.RABBITMQ_MAX_PRIORITY + 1)
channel.basic_publish(
properties=pika.BasicProperties(priority=priority),
exchange="",
Expand Down Expand Up @@ -72,7 +73,6 @@ def test_task_queue(self):
assert task.get_retry_count(conn) == 1

with patch("servicelayer.settings.WORKER_RETRY", 0):
priority = randrange(1, settings.RABBITMQ_MAX_PRIORITY + 1)
channel = connection.channel()
channel.queue_purge(settings.QUEUE_INGEST)
channel.basic_publish(
Expand Down

0 comments on commit 3ddfebe

Please sign in to comment.