Skip to content

Commit

Permalink
re-enable schedule tests in session (Azure#11184)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhaoling authored May 1, 2020
1 parent d5ba8a4 commit f94fc3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ async def test_async_session_schedule_message(self, servicebus_namespace_connect
await renewer.shutdown()


@pytest.mark.skip(reason='requires scheduling functionality')
@pytest.mark.liveTest
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
Expand All @@ -638,7 +637,7 @@ async def test_async_session_schedule_multiple_messages(self, servicebus_namespa
message_id_b = uuid.uuid4()
message_b = Message(content, session_id=session_id)
message_b.properties.message_id = message_id_b
tokens = await sender.schedule(enqueue_time, message_a, message_b)
tokens = await sender.schedule([message_a, message_b], enqueue_time)
assert len(tokens) == 2

renewer = AutoLockRenew()
Expand All @@ -658,7 +657,6 @@ async def test_async_session_schedule_multiple_messages(self, servicebus_namespa
await renewer.shutdown()


@pytest.mark.skip(reasion="requires scheduling")
@pytest.mark.liveTest
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
Expand All @@ -673,9 +671,9 @@ async def test_async_session_cancel_scheduled_messages(self, servicebus_namespac
async with sb_client.get_queue_sender(servicebus_queue.name) as sender:
message_a = Message("Test scheduled message", session_id=session_id)
message_b = Message("Test scheduled message", session_id=session_id)
tokens = await sender.schedule(enqueue_time, message_a, message_b)
tokens = await sender.schedule([message_a, message_b], enqueue_time)
assert len(tokens) == 2
await sender.cancel_scheduled_messages(*tokens)
await sender.cancel_scheduled_messages(tokens)

renewer = AutoLockRenew()
messages = []
Expand Down
11 changes: 4 additions & 7 deletions sdk/servicebus/azure-servicebus/tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ def test_session_message_expiry(self, servicebus_namespace_connection_string, se
messages[0].complete()


@pytest.mark.skip(reason='Requires schedule functionality')
@pytest.mark.liveTest
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
Expand All @@ -673,7 +672,7 @@ def test_session_schedule_message(self, servicebus_namespace_connection_string,
message_id = uuid.uuid4()
message = Message(content, session_id=session_id)
message.properties.message_id = message_id
message.schedule(enqueue_time)
message.scheduled_enqueue_time_utc = enqueue_time
sender.send(message)

messages = []
Expand All @@ -691,7 +690,6 @@ def test_session_schedule_message(self, servicebus_namespace_connection_string,
assert len(messages) == 1


@pytest.mark.skip(reason='Requires schedule functionality')
@pytest.mark.liveTest
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
Expand All @@ -714,7 +712,7 @@ def test_session_schedule_multiple_messages(self, servicebus_namespace_connectio
message_id_b = uuid.uuid4()
message_b = Message(content, session_id=session_id)
message_b.properties.message_id = message_id_b
tokens = sender.schedule(enqueue_time, message_a, message_b)
tokens = sender.schedule([message_a, message_b], enqueue_time)
assert len(tokens) == 2

messages = []
Expand All @@ -733,7 +731,6 @@ def test_session_schedule_multiple_messages(self, servicebus_namespace_connectio
assert len(messages) == 2


@pytest.mark.skip(reason='Requires schedule functionality')
@pytest.mark.liveTest
@pytest.mark.live_test_only
@CachedResourceGroupPreparer(name_prefix='servicebustest')
Expand All @@ -750,9 +747,9 @@ def test_session_cancel_scheduled_messages(self, servicebus_namespace_connection
with sb_client.get_queue_sender(servicebus_queue.name) as sender:
message_a = Message("Test scheduled message", session_id=session_id)
message_b = Message("Test scheduled message", session_id=session_id)
tokens = sender.schedule(enqueue_time, message_a, message_b)
tokens = sender.schedule([message_a, message_b], enqueue_time)
assert len(tokens) == 2
sender.cancel_scheduled_messages(*tokens)
sender.cancel_scheduled_messages(tokens)

with sb_client.get_queue_session_receiver(servicebus_queue.name, session_id=session_id) as receiver:
messages = []
Expand Down

0 comments on commit f94fc3f

Please sign in to comment.