Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -420,16 +419,18 @@ 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;
});

// 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();
Expand Down Expand Up @@ -504,10 +505,6 @@ public async Task MultipleFunctionsBindingToSameEntity()
await TestMultiple<ServiceBusSingleMessageTestJob_BindMultipleFunctionsToSameEntity>();
}

/*
* Helper functions
*/

private async Task TestSingleDrainMode<T>(bool sendToQueue)
{
var host = BuildHost<T>(BuildDrainHost<T>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down