Skip to content

Commit

Permalink
PendingOffset state from origin as current test was inconsistent
Browse files Browse the repository at this point in the history
  • Loading branch information
csinig committed Jul 10, 2023
1 parent caa3891 commit e485741
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/KafkaFlow.UnitTests/OffsetCommitterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IDependencyResolver, IEnumerable<TopicPartitionOffset>> 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));
}

Expand Down

0 comments on commit e485741

Please sign in to comment.