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

CV2-5589 reverts accidental regression #124

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/queue/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def receive_messages(self, batch_size: int = 1):
Receive messages from a queue.
"""
queue = self.get_or_create_queue(self.input_queue_name)[0]
return queue.receive_messages(MaxNumberOfMessages=min(batch_size, SQS_MAX_BATCH_SIZE))
return [(m, self.input_queue_name) for m in queue.receive_messages(MaxNumberOfMessages=min(batch_size, SQS_MAX_BATCH_SIZE))]

def find_queue_by_name(self, queue_name: str) -> boto3.resources.base.ServiceResource:
"""
Expand Down
4 changes: 2 additions & 2 deletions test/lib/queue/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def test_receive_messages(self):
received_messages = self.queue.receive_messages(5)
# Assertions
self.assertEqual(len(received_messages), 2)
self.assertIn("a test", json.loads(received_messages[0].body)["body"]["text"])
self.assertIn("another test", json.loads(received_messages[1].body)["body"]["text"])
self.assertIn("a test", json.loads(received_messages[0][0].body)["body"]["text"])
self.assertIn("another test", json.loads(received_messages[1][0].body)["body"]["text"])

def test_restrict_queues_by_suffix(self):
queues = [
Expand Down
Loading