From 9036847eae9f0861453e73634b6a0824af16ae3a Mon Sep 17 00:00:00 2001 From: Djordje Djukic Date: Fri, 12 Apr 2024 00:14:45 +0200 Subject: [PATCH] RavenDB-21956 Cleanup queues after tests --- .../ETL/Queue/AzureQueueStorageEtlTestBase.cs | 17 +++++++++++++++++ .../ETL/Queue/AzureQueueStorageEtlTests.cs | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTestBase.cs b/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTestBase.cs index b0b3ac07f604..de8e97bf75f2 100644 --- a/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTestBase.cs +++ b/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTestBase.cs @@ -107,4 +107,21 @@ protected string GenerateLargeString() return builder.ToString(); } + + private void CleanupQueues() + { + QueueServiceClient client = new(ConnectionString); + var queues = client.GetQueues(); + + foreach (var queue in queues) + { + client.DeleteQueue(queue.Name); + } + } + + public override void Dispose() + { + base.Dispose(); + CleanupQueues(); + } } diff --git a/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTests.cs b/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTests.cs index c6043950d058..9a357716f70a 100644 --- a/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTests.cs +++ b/test/SlowTests/Server/Documents/ETL/Queue/AzureQueueStorageEtlTests.cs @@ -101,7 +101,7 @@ public void Error_if_script_does_not_contain_any_loadTo_method() { Name = "test", ConnectionStringName = "test", - BrokerType = QueueBrokerType.RabbitMq, + BrokerType = QueueBrokerType.AzureQueueStorage, Transforms = { new Transformation @@ -114,9 +114,9 @@ public void Error_if_script_does_not_contain_any_loadTo_method() config.Initialize(new QueueConnectionString { Name = "Foo", - BrokerType = QueueBrokerType.RabbitMq, - RabbitMqConnectionSettings = - new RabbitMqConnectionSettings() { ConnectionString = "amqp://guest:guest@localhost:5672/" } + BrokerType = QueueBrokerType.AzureQueueStorage, + AzureQueueStorageConnectionSettings = + new AzureQueueStorageConnectionSettings() { ConnectionString = ConnectionString } }); List errors;