Respect VisibilityTimeout when calling receive_message
Previously, receive_message would always use the queue's default visibility timeout instead of the value passed as a query parameter when calling the receive_message method on an SQS connection.
This commit is contained in:
parent
4372c346d9
commit
9b7902018f
3 changed files with 46 additions and 8 deletions
|
|
@ -203,6 +203,23 @@ def test_message_becomes_inflight_when_received():
|
|||
queue.count().should.equal(1)
|
||||
|
||||
|
||||
@mock_sqs
|
||||
def test_receive_message_with_explicit_visibility_timeout():
|
||||
conn = boto.connect_sqs('the_key', 'the_secret')
|
||||
queue = conn.create_queue("test-queue", visibility_timeout=60)
|
||||
queue.set_message_class(RawMessage)
|
||||
|
||||
body_one = 'this is another test message'
|
||||
queue.write(queue.new_message(body_one))
|
||||
|
||||
queue.count().should.equal(1)
|
||||
messages = conn.receive_message(queue, number_messages=1, visibility_timeout=0)
|
||||
|
||||
assert len(messages) == 1
|
||||
|
||||
# Message should remain visible
|
||||
queue.count().should.equal(1)
|
||||
|
||||
@mock_sqs
|
||||
def test_change_message_visibility():
|
||||
conn = boto.connect_sqs('the_key', 'the_secret')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue