diff --git a/src/KafkaFlow.UnitTests/OffsetCommitterTests.cs b/src/KafkaFlow.UnitTests/OffsetCommitterTests.cs index 285887c08..6298c3018 100644 --- a/src/KafkaFlow.UnitTests/OffsetCommitterTests.cs +++ b/src/KafkaFlow.UnitTests/OffsetCommitterTests.cs @@ -80,17 +80,19 @@ public void PendingOffsetsState_ShouldExecuteHandlers() // Arrange var ready = new ManualResetEvent(false); - var committer = new OffsetCommitter( + using var committer = new OffsetCommitter( this.consumerMock.Object, this.dependencyResolverMock.Object, new List<(Action> handler, TimeSpan interval)> { - ((_, _) => ready.Set(), new TimeSpan(0, 0, 10)), + ((_, _) => ready.Set(), TimeSpan.FromMilliseconds(100)), }, this.logHandlerMock.Object); // Act committer.MarkAsProcessed(new TopicPartitionOffset(this.topicPartition, new Offset(1))); + + // Assert Assert.IsTrue(ready.WaitOne(TestTimeout)); }