Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LGouellec committed Jul 31, 2024
1 parent 2128fc6 commit c8356d7
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 124 deletions.
4 changes: 0 additions & 4 deletions core/KafkaStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,12 @@ public void Start(CancellationToken? token = null)
public async Task StartAsync(CancellationToken? token = null)
{
if (token.HasValue)
<<<<<<< HEAD
token.Value.Register(Dispose);
=======
{
token.Value.Register(() => {
_cancelSource.Cancel();
Dispose();
});
}
>>>>>>> develop

await Task.Factory.StartNew(() =>
{
Expand Down
8 changes: 7 additions & 1 deletion core/Processors/GlobalStreamThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,13 @@ protected virtual void Dispose(bool waitForThread)

if (waitForThread)
{
thread.Join();
try
{
thread.Join();
}
catch (ThreadStateException)
{
}
}

SetState(GlobalThreadState.DEAD);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using Streamiz.Kafka.Net.Mock;

namespace Streamiz.Kafka.Net.Metrics.OpenTelemetry
{
Expand Down
70 changes: 0 additions & 70 deletions samples/sample-stream/Reproducer328.cs

This file was deleted.

6 changes: 0 additions & 6 deletions samples/sample-stream/sample-stream.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.12" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.3" />
<PackageReference Include="OpenTelemetry.Api" Version="1.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\core\Streamiz.Kafka.Net.csproj" />
<ProjectReference Include="..\..\metrics\Streamiz.Kafka.Net.Metrics.Prometheus\Streamiz.Kafka.Net.Metrics.Prometheus.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ public void SetUp()
stateManager.SetGlobalProcessorContext(context);
}

[TearDown]
public void Dispose()
{

}

[Test]
public void ShouldInitializeStateStores()
{
Expand Down
Loading

0 comments on commit c8356d7

Please sign in to comment.