Skip to content

Commit

Permalink
test: different config for MultiThread config test
Browse files Browse the repository at this point in the history
  • Loading branch information
VonDerBeck committed Sep 25, 2024
1 parent 8f87364 commit f18b406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

namespace Zeebe.Client.Accelerator.Integration.Tests.Handlers
{
[MaxJobsActive(60)]
[HandlerThreads(3)]
[MaxJobsActive(120)]
[HandlerThreads(8)]
public class MultiThreadJobHandler : IAsyncZeebeWorkerWithResult<Output>
{

Expand Down
7 changes: 4 additions & 3 deletions test/Zeebe.Client.Accelerator.Integration.Tests/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public async Task UsesMultipleThreadsWhenConfigured()
Assert.True(deployResponse.Key > 0);

var input = new List<int>();
for (int i = 0; i < 60; i++) input.Add(i);
for (int i = 0; i < 120; i++) input.Add(i);

var correlationId = Guid.NewGuid();
await zeebeClient.NewCreateProcessInstanceCommand()
Expand All @@ -155,10 +155,11 @@ await zeebeClient.NewCreateProcessInstanceCommand()
CorrelationId = correlationId
})
.Send();
WaitForHandlersToComplete(60, 6000);
WaitForHandlersToComplete(120, 10000);

var variables = zeebeClient.ReceiveMessage<MultiThreadVariables>("responseFor_" + correlationId, TimeSpan.FromSeconds(25));
Assert.True(variables.UsedThreads.Distinct().Count() >= 3); // not exact due to the underlying TPL implementation internals
_testOutputHelper.WriteLine("NumThreads: " + variables.UsedThreads.Distinct().Count());
Assert.True(variables.UsedThreads.Distinct().Count() >= 8); // not exact due to the underlying TPL implementation internals

}

Expand Down

0 comments on commit f18b406

Please sign in to comment.