Skip to content

Commit

Permalink
Merge pull request #126 from kpn/fix/end_offsets
Browse files Browse the repository at this point in the history
fix: end_offsets off by 1
  • Loading branch information
reidmeyer authored Aug 2, 2023
2 parents c884319 + dd603f1 commit 7c3d84c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kstreams/test_utils/test_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async def end_offsets(
) -> Dict[TopicPartition, int]:
topic = TopicManager.get(partitions[0].topic)
end_offsets = {
topic_partition: topic.offset(partition=topic_partition.partition)
topic_partition: topic.offset(partition=topic_partition.partition) + 1
for topic_partition in partitions
}
return end_offsets
Expand Down
6 changes: 3 additions & 3 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ async def consume(stream):

stream = stream_engine.get_stream("my-stream")
assert (await stream.consumer.end_offsets(topic_partitions)) == {
TopicPartition(topic="local--kstreams", partition=0): 1,
TopicPartition(topic="local--kstreams", partition=2): 0,
TopicPartition(topic="local--kstreams", partition=10): 0,
TopicPartition(topic="local--kstreams", partition=0): 2,
TopicPartition(topic="local--kstreams", partition=2): 1,
TopicPartition(topic="local--kstreams", partition=10): 1,
}


Expand Down

0 comments on commit 7c3d84c

Please sign in to comment.