Skip to content

Commit

Permalink
[Service Bus] reduce livetest time (Azure#18176)
Browse files Browse the repository at this point in the history
* change mgmt livetests to recordings

* set lock duration low for less sleep
  • Loading branch information
swathipil authored and rakshith91 committed Jun 1, 2021
1 parent 16b399a commit 2d29023
Show file tree
Hide file tree
Showing 16 changed files with 367 additions and 377 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ interactions:
Accept:
- application/xml
User-Agent:
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.9.0 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/$Resources/queues?$skip=0&$top=100&api-version=2017-04
response:
body:
string: <feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Queues</title><id>https://servicebustestddyod7uodu.servicebus.windows.net/$Resources/queues?$skip=0&amp;$top=100&amp;api-version=2017-04</id><updated>2021-03-02T19:55:45Z</updated><link
rel="self" href="https://servicebustestddyod7uodu.servicebus.windows.net/$Resources/queues?$skip=0&amp;$top=100&amp;api-version=2017-04"/></feed>
string: <feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Queues</title><id>https://servicebustestppoxgfmrp5.servicebus.windows.net/$Resources/queues?$skip=0&amp;$top=100&amp;api-version=2017-04</id><updated>2021-04-19T17:46:31Z</updated><link
rel="self" href="https://servicebustestppoxgfmrp5.servicebus.windows.net/$Resources/queues?$skip=0&amp;$top=100&amp;api-version=2017-04"/></feed>
headers:
content-type: application/atom+xml;type=feed;charset=utf-8
date: Tue, 02 Mar 2021 19:55:45 GMT
date: Mon, 19 Apr 2021 17:46:31 GMT
server: Microsoft-HTTPAPI/2.0
transfer-encoding: chunked
status:
code: 200
message: OK
url: https://servicebustestddyod7uodu.servicebus.windows.net/$Resources/queues?$skip=0&$top=100&api-version=2017-04
url: https://servicebustestppoxgfmrp5.servicebus.windows.net/$Resources/queues?$skip=0&$top=100&api-version=2017-04
- request:
body: '<?xml version=''1.0'' encoding=''utf-8''?>
Expand All @@ -34,46 +34,46 @@ interactions:
Content-Type:
- application/atom+xml
User-Agent:
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.9.0 (Windows-10-10.0.19041-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/fjruid?api-version=2017-04
response:
body:
string: <entry xmlns="http://www.w3.org/2005/Atom"><id>https://servicebustestddyod7uodu.servicebus.windows.net/fjruid?api-version=2017-04</id><title
type="text">fjruid</title><published>2021-03-02T19:55:46Z</published><updated>2021-03-02T19:55:46Z</updated><author><name>servicebustestddyod7uodu</name></author><link
rel="self" href="https://servicebustestddyod7uodu.servicebus.windows.net/fjruid?api-version=2017-04"/><content
string: <entry xmlns="http://www.w3.org/2005/Atom"><id>https://servicebustestppoxgfmrp5.servicebus.windows.net/fjruid?api-version=2017-04</id><title
type="text">fjruid</title><published>2021-04-19T17:46:32Z</published><updated>2021-04-19T17:46:32Z</updated><author><name>servicebustestppoxgfmrp5</name></author><link
rel="self" href="https://servicebustestppoxgfmrp5.servicebus.windows.net/fjruid?api-version=2017-04"/><content
type="application/xml"><QueueDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><LockDuration>PT1M</LockDuration><MaxSizeInMegabytes>1024</MaxSizeInMegabytes><RequiresDuplicateDetection>false</RequiresDuplicateDetection><RequiresSession>false</RequiresSession><DefaultMessageTimeToLive>P10675199DT2H48M5.4775807S</DefaultMessageTimeToLive><DeadLetteringOnMessageExpiration>false</DeadLetteringOnMessageExpiration><DuplicateDetectionHistoryTimeWindow>PT10M</DuplicateDetectionHistoryTimeWindow><MaxDeliveryCount>10</MaxDeliveryCount><EnableBatchedOperations>true</EnableBatchedOperations><SizeInBytes>0</SizeInBytes><MessageCount>0</MessageCount><IsAnonymousAccessible>false</IsAnonymousAccessible><AuthorizationRules></AuthorizationRules><Status>Active</Status><CreatedAt>2021-03-02T19:55:46.453Z</CreatedAt><UpdatedAt>2021-03-02T19:55:46.497Z</UpdatedAt><SupportOrdering>true</SupportOrdering><AutoDeleteOnIdle>P10675199DT2H48M5.4775807S</AutoDeleteOnIdle><EnablePartitioning>false</EnablePartitioning><EntityAvailabilityStatus>Available</EntityAvailabilityStatus><EnableExpress>false</EnableExpress></QueueDescription></content></entry>
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><LockDuration>PT1M</LockDuration><MaxSizeInMegabytes>1024</MaxSizeInMegabytes><RequiresDuplicateDetection>false</RequiresDuplicateDetection><RequiresSession>false</RequiresSession><DefaultMessageTimeToLive>P10675199DT2H48M5.4775807S</DefaultMessageTimeToLive><DeadLetteringOnMessageExpiration>false</DeadLetteringOnMessageExpiration><DuplicateDetectionHistoryTimeWindow>PT10M</DuplicateDetectionHistoryTimeWindow><MaxDeliveryCount>10</MaxDeliveryCount><EnableBatchedOperations>true</EnableBatchedOperations><SizeInBytes>0</SizeInBytes><MessageCount>0</MessageCount><IsAnonymousAccessible>false</IsAnonymousAccessible><AuthorizationRules></AuthorizationRules><Status>Active</Status><CreatedAt>2021-04-19T17:46:32.093Z</CreatedAt><UpdatedAt>2021-04-19T17:46:32.17Z</UpdatedAt><SupportOrdering>true</SupportOrdering><AutoDeleteOnIdle>P10675199DT2H48M5.4775807S</AutoDeleteOnIdle><EnablePartitioning>false</EnablePartitioning><EntityAvailabilityStatus>Available</EntityAvailabilityStatus><EnableExpress>false</EnableExpress></QueueDescription></content></entry>
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
date: Tue, 02 Mar 2021 19:55:46 GMT
date: Mon, 19 Apr 2021 17:46:32 GMT
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
url: https://servicebustestddyod7uodu.servicebus.windows.net/fjruid?api-version=2017-04
url: https://servicebustestppoxgfmrp5.servicebus.windows.net/fjruid?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.9.0 (Windows-10-10.0.19041-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/fjruid?api-version=2017-04
response:
body:
string: ''
headers:
content-length: '0'
date: Tue, 02 Mar 2021 19:55:47 GMT
etag: '637503117464970000'
date: Mon, 19 Apr 2021 17:46:33 GMT
etag: '637544511921700000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
url: https://servicebustestddyod7uodu.servicebus.windows.net/fjruid?api-version=2017-04
url: https://servicebustestppoxgfmrp5.servicebus.windows.net/fjruid?api-version=2017-04
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ interactions:
Accept:
- application/xml
User-Agent:
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.9.0 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
response:
body:
string: <feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Topics</title><id>https://servicebustestqmzhmfhh7b.servicebus.windows.net/$Resources/topics?$skip=0&amp;$top=100&amp;api-version=2017-04</id><updated>2021-03-02T19:57:09Z</updated><link
rel="self" href="https://servicebustestqmzhmfhh7b.servicebus.windows.net/$Resources/topics?$skip=0&amp;$top=100&amp;api-version=2017-04"/></feed>
string: <feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Topics</title><id>https://servicebustesterxlnliq4u.servicebus.windows.net/$Resources/topics?$skip=0&amp;$top=100&amp;api-version=2017-04</id><updated>2021-04-19T17:30:33Z</updated><link
rel="self" href="https://servicebustesterxlnliq4u.servicebus.windows.net/$Resources/topics?$skip=0&amp;$top=100&amp;api-version=2017-04"/></feed>
headers:
content-type: application/atom+xml;type=feed;charset=utf-8
date: Tue, 02 Mar 2021 19:57:09 GMT
date: Mon, 19 Apr 2021 17:30:33 GMT
server: Microsoft-HTTPAPI/2.0
transfer-encoding: chunked
status:
code: 200
message: OK
url: https://servicebustestqmzhmfhh7b.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
url: https://servicebustesterxlnliq4u.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
- request:
body: '<?xml version=''1.0'' encoding=''utf-8''?>
Expand All @@ -34,46 +34,46 @@ interactions:
Content-Type:
- application/atom+xml
User-Agent:
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.9.0 (Windows-10-10.0.19041-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/fjruid?api-version=2017-04
response:
body:
string: <entry xmlns="http://www.w3.org/2005/Atom"><id>https://servicebustestqmzhmfhh7b.servicebus.windows.net/fjruid?api-version=2017-04</id><title
type="text">fjruid</title><published>2021-03-02T19:57:09Z</published><updated>2021-03-02T19:57:09Z</updated><author><name>servicebustestqmzhmfhh7b</name></author><link
rel="self" href="https://servicebustestqmzhmfhh7b.servicebus.windows.net/fjruid?api-version=2017-04"/><content
string: <entry xmlns="http://www.w3.org/2005/Atom"><id>https://servicebustesterxlnliq4u.servicebus.windows.net/fjruid?api-version=2017-04</id><title
type="text">fjruid</title><published>2021-04-19T17:30:33Z</published><updated>2021-04-19T17:30:34Z</updated><author><name>servicebustesterxlnliq4u</name></author><link
rel="self" href="https://servicebustesterxlnliq4u.servicebus.windows.net/fjruid?api-version=2017-04"/><content
type="application/xml"><TopicDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><DefaultMessageTimeToLive>P10675199DT2H48M5.4775807S</DefaultMessageTimeToLive><MaxSizeInMegabytes>1024</MaxSizeInMegabytes><RequiresDuplicateDetection>false</RequiresDuplicateDetection><DuplicateDetectionHistoryTimeWindow>PT10M</DuplicateDetectionHistoryTimeWindow><EnableBatchedOperations>true</EnableBatchedOperations><SizeInBytes>0</SizeInBytes><FilteringMessagesBeforePublishing>false</FilteringMessagesBeforePublishing><IsAnonymousAccessible>false</IsAnonymousAccessible><AuthorizationRules></AuthorizationRules><Status>Active</Status><CreatedAt>2021-03-02T19:57:09.773Z</CreatedAt><UpdatedAt>2021-03-02T19:57:09.803Z</UpdatedAt><SupportOrdering>true</SupportOrdering><AutoDeleteOnIdle>P10675199DT2H48M5.4775807S</AutoDeleteOnIdle><EnablePartitioning>false</EnablePartitioning><EntityAvailabilityStatus>Available</EntityAvailabilityStatus><EnableSubscriptionPartitioning>false</EnableSubscriptionPartitioning><EnableExpress>false</EnableExpress></TopicDescription></content></entry>
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><DefaultMessageTimeToLive>P10675199DT2H48M5.4775807S</DefaultMessageTimeToLive><MaxSizeInMegabytes>1024</MaxSizeInMegabytes><RequiresDuplicateDetection>false</RequiresDuplicateDetection><DuplicateDetectionHistoryTimeWindow>PT10M</DuplicateDetectionHistoryTimeWindow><EnableBatchedOperations>true</EnableBatchedOperations><SizeInBytes>0</SizeInBytes><FilteringMessagesBeforePublishing>false</FilteringMessagesBeforePublishing><IsAnonymousAccessible>false</IsAnonymousAccessible><AuthorizationRules></AuthorizationRules><Status>Active</Status><CreatedAt>2021-04-19T17:30:33.93Z</CreatedAt><UpdatedAt>2021-04-19T17:30:34.087Z</UpdatedAt><SupportOrdering>true</SupportOrdering><AutoDeleteOnIdle>P10675199DT2H48M5.4775807S</AutoDeleteOnIdle><EnablePartitioning>false</EnablePartitioning><EntityAvailabilityStatus>Available</EntityAvailabilityStatus><EnableSubscriptionPartitioning>false</EnableSubscriptionPartitioning><EnableExpress>false</EnableExpress></TopicDescription></content></entry>
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
date: Tue, 02 Mar 2021 19:57:10 GMT
date: Mon, 19 Apr 2021 17:30:34 GMT
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
url: https://servicebustestqmzhmfhh7b.servicebus.windows.net/fjruid?api-version=2017-04
url: https://servicebustesterxlnliq4u.servicebus.windows.net/fjruid?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.0 (Windows-10-10.0.19041-SP0)
- azsdk-python-servicebusmanagementclient/2017-04 Python/3.9.0 (Windows-10-10.0.19041-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/fjruid?api-version=2017-04
response:
body:
string: ''
headers:
content-length: '0'
date: Tue, 02 Mar 2021 19:57:10 GMT
etag: '637503118298030000'
date: Mon, 19 Apr 2021 17:30:35 GMT
etag: '637544502340870000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
url: https://servicebustestqmzhmfhh7b.servicebus.windows.net/fjruid?api-version=2017-04
url: https://servicebustesterxlnliq4u.servicebus.windows.net/fjruid?api-version=2017-04
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ async def test_mgmt_queue_async_update_dict_success(self, servicebus_namespace_c
await mgmt_service.delete_queue(queue_name)
await mgmt_service.close()

@pytest.mark.liveTest
@CachedResourceGroupPreparer(name_prefix='servicebustest')
@CachedServiceBusNamespacePreparer(name_prefix='servicebustest')
async def test_mgmt_queue_async_update_dict_error(self, servicebus_namespace_connection_string, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ async def test_mgmt_topic_async_update_dict_success(self, servicebus_namespace_c
await mgmt_service.delete_topic(topic_name)
await mgmt_service.close()

@pytest.mark.liveTest
@CachedResourceGroupPreparer(name_prefix='servicebustest')
@CachedServiceBusNamespacePreparer(name_prefix='servicebustest')
async def test_mgmt_topic_async_update_dict_error(self, servicebus_namespace_connection_string, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async def test_github_issue_6178_async(self, servicebus_namespace_connection_str
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
@CachedServiceBusNamespacePreparer(name_prefix='servicebustest')
@ServiceBusQueuePreparer(name_prefix='servicebustest', dead_lettering_on_message_expiration=True)
@ServiceBusQueuePreparer(name_prefix='servicebustest', dead_lettering_on_message_expiration=True, lock_duration='PT10S')
async def test_async_queue_by_queue_client_conn_str_receive_handler_receiveanddelete(self, servicebus_namespace_connection_string, servicebus_queue, **kwargs):
async with ServiceBusClient.from_connection_string(
servicebus_namespace_connection_string, logging_enable=False) as sb_client:
Expand All @@ -231,7 +231,7 @@ async def test_async_queue_by_queue_client_conn_str_receive_handler_receiveandde

assert not receiver._running
assert len(messages) == 10
time.sleep(30)
time.sleep(10)

messages = []
async with sb_client.get_queue_receiver(servicebus_queue.name, receive_mode=ServiceBusReceiveMode.RECEIVE_AND_DELETE, max_wait_time=5) as receiver:
Expand Down Expand Up @@ -896,10 +896,10 @@ async def test_async_queue_message_time_to_live(self, servicebus_namespace_conne
content = str(uuid.uuid4())
message_id = uuid.uuid4()
message = ServiceBusMessage(content)
message.time_to_live = timedelta(seconds=30)
message.time_to_live = timedelta(seconds=15)
await sender.send_messages(message)

time.sleep(30)
time.sleep(15)
async with sb_client.get_queue_receiver(servicebus_queue.name) as receiver:
messages = await receiver.receive_messages(max_wait_time=10)
assert not messages
Expand Down Expand Up @@ -1026,7 +1026,7 @@ async def test_async_queue_message_lock_renew(self, servicebus_namespace_connect
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
@CachedServiceBusNamespacePreparer(name_prefix='servicebustest')
@ServiceBusQueuePreparer(name_prefix='servicebustest', dead_lettering_on_message_expiration=True)
@ServiceBusQueuePreparer(name_prefix='servicebustest', dead_lettering_on_message_expiration=True, lock_duration='PT10S')
async def test_async_queue_message_receive_and_delete(self, servicebus_namespace_connection_string, servicebus_queue, **kwargs):
async with ServiceBusClient.from_connection_string(
servicebus_namespace_connection_string, logging_enable=False) as sb_client:
Expand All @@ -1051,7 +1051,7 @@ async def test_async_queue_message_receive_and_delete(self, servicebus_namespace
with pytest.raises(ValueError):
await receiver.renew_message_lock(message)

time.sleep(30)
time.sleep(10)
async with sb_client.get_queue_receiver(servicebus_queue.name) as receiver:
messages = await receiver.receive_messages(max_wait_time=10)
for m in messages:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def test_async_session_by_session_client_conn_str_receive_handler_peeklock
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
@CachedServiceBusNamespacePreparer(name_prefix='servicebustest')
@ServiceBusQueuePreparer(name_prefix='servicebustest', requires_session=True)
@ServiceBusQueuePreparer(name_prefix='servicebustest', requires_session=True, lock_duration='PT5S')
async def test_async_session_by_queue_client_conn_str_receive_handler_receiveanddelete(self, servicebus_namespace_connection_string, servicebus_queue, **kwargs):
async with ServiceBusClient.from_connection_string(
servicebus_namespace_connection_string, logging_enable=False) as sb_client:
Expand All @@ -107,7 +107,7 @@ async def test_async_session_by_queue_client_conn_str_receive_handler_receiveand

assert not receiver._running
assert len(messages) == 10
time.sleep(30)
time.sleep(5)

messages = []
async with sb_client.get_queue_receiver(servicebus_queue.name, session_id=session_id, receive_mode=ServiceBusReceiveMode.RECEIVE_AND_DELETE, max_wait_time=5) as receiver:
Expand Down
Loading

0 comments on commit 2d29023

Please sign in to comment.