diff --git a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusEndToEndTests.cs b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusEndToEndTests.cs index dd1b76119392..7d0290b694a8 100644 --- a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusEndToEndTests.cs +++ b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusEndToEndTests.cs @@ -20,7 +20,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Moq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NUnit.Framework; @@ -420,8 +419,10 @@ public async Task DynamicConcurrencyTest() } await WriteQueueMessages(messages); - // start the host and wait for all messages to be processed + // start the host await host.StartAsync(); + + // wait for all messages to be processed await TestHelpers.Await(() => { return DynamicConcurrencyTestJob.InvocationCount >= numMessages; @@ -429,7 +430,7 @@ await TestHelpers.Await(() => // ensure we've dynamically increased concurrency concurrencyStatus = concurrencyManager.GetStatus(functionId); - Assert.GreaterOrEqual(concurrencyStatus.CurrentConcurrency, 10); + Assert.GreaterOrEqual(concurrencyStatus.CurrentConcurrency, 5); // check a few of the concurrency logs var concurrencyLogs = host.GetTestLoggerProvider().GetAllLogMessages().Where(p => p.Category == LogCategories.Concurrency).Select(p => p.FormattedMessage).ToList(); @@ -504,10 +505,6 @@ public async Task MultipleFunctionsBindingToSameEntity() await TestMultiple(); } - /* - * Helper functions - */ - private async Task TestSingleDrainMode(bool sendToQueue) { var host = BuildHost(BuildDrainHost()); diff --git a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusSessionsEndToEndTests.cs b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusSessionsEndToEndTests.cs index eed0f7fd41d5..89b135f318e6 100644 --- a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusSessionsEndToEndTests.cs +++ b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/tests/ServiceBusSessionsEndToEndTests.cs @@ -81,8 +81,10 @@ public async Task DynamicConcurrencyTest_Sessions() } await WriteQueueMessages(messages, sessionIds); - // start the host and wait for all messages to be processed + // start the host await host.StartAsync(); + + // wait for all messages to be processed await TestHelpers.Await(() => { return DynamicConcurrencyTestJob.InvocationCount >= numMessages; diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Scenario.Tests/tests/AzureStorageEndToEndTests.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Scenario.Tests/tests/AzureStorageEndToEndTests.cs index 9232bee79d44..f1b58e606215 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Scenario.Tests/tests/AzureStorageEndToEndTests.cs +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Scenario.Tests/tests/AzureStorageEndToEndTests.cs @@ -215,7 +215,7 @@ public async Task DynamicConcurrency_Queues() Assert.AreEqual(1, concurrencyStatus.CurrentConcurrency); // write a bunch of queue messages - int numMessages = 300; + int numMessages = 500; string queueName = _resolver.ResolveInString(DynamicConcurrencyQueueName); await WriteQueueMessages(queueName, numMessages); @@ -279,14 +279,14 @@ public async Task DynamicConcurrency_Blobs() Assert.AreEqual(1, concurrencyStatus.CurrentConcurrency); // write some blobs - int numBlobs = 50; + int numBlobs = 100; string blobContainerName = _resolver.ResolveInString(DynamicConcurrencyBlobContainerName); await WriteBlobs(blobContainerName, numBlobs); // start the host await host.StartAsync(); - // wait for all messages to be processed + // wait for all blobs to be processed await TestHelpers.Await(() => { return DynamicConcurrencyTestJob.InvocationCount >= numBlobs;