Skip to content

Commit

Permalink
test: upgraded to xunit 2.9.2, Testcontainers 3.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
VonDerBeck committed Sep 30, 2024
1 parent f18b406 commit ddabe8e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 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(120)]
[HandlerThreads(8)]
[MaxJobsActive(20)]
[HandlerThreads(3)]
public class MultiThreadJobHandler : IAsyncZeebeWorkerWithResult<Output>
{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Org.BouncyCastle.Asn1.Mozilla;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Configurations;
using DotNet.Testcontainers.Containers;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -64,13 +63,13 @@ public async ValueTask DisposeAsync()

private static IContainer SetupZeebe(ILogger logger, string version)
{
TestcontainersSettings.Logger = logger;
var container = new ContainerBuilder()
.WithImage($"camunda/zeebe:{version}")
.WithName("zeebe-testcontainer")
.WithPortBinding(IntegrationTestHelper.ZeebePort)
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(IntegrationTestHelper.ZeebePort))
.WithCleanUp(true)
.WithLogger(logger)
.Build();

return container;
Expand Down
6 changes: 3 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 < 120; i++) input.Add(i);
for (int i = 0; i < 20; i++) input.Add(i);

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

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

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -17,7 +17,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Testcontainers" Version="3.6.0" />
<PackageReference Include="Testcontainers" Version="3.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ddabe8e

Please sign in to comment.