This is an automated email from the ASF dual-hosted git repository. mjsax pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new 6694ea424a5 KAFKA-15347: fix unit test (#14947) 6694ea424a5 is described below commit 6694ea424a5d53138898c542bc865706072a6b57 Author: Alieh Saeedi <107070585+aliehsaee...@users.noreply.github.com> AuthorDate: Thu Dec 7 04:53:43 2023 +0100 KAFKA-15347: fix unit test (#14947) Reviewers: Matthias J. Sax <matth...@confluent.io> --- .../RocksDBVersionedStoreSegmentValueFormatterTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatterTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatterTest.java index c6cc12c93a7..4c7564c9156 100644 --- a/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatterTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatterTest.java @@ -230,13 +230,19 @@ public class RocksDBVersionedStoreSegmentValueFormatterTest { segmentValue.findAll(testCase.records.get(testCase.records.size() - 1).timestamp, testCase.records.get(0).timestamp); int i = 0; + int index = 0; for (final TestRecord expectedRecord : testCase.records) { - final long expectedValidTo = i == 0 ? testCase.nextTimestamp : testCase.records.get(i - 1).timestamp; - assertThat(results.get(i).index(), equalTo(i)); + if (expectedRecord.value == null) { // should not return tombstones + index++; + continue; + } + final long expectedValidTo = index == 0 ? testCase.nextTimestamp : testCase.records.get(index - 1).timestamp; + assertThat(results.get(i).index(), equalTo(index)); assertThat(results.get(i).value(), equalTo(expectedRecord.value)); assertThat(results.get(i).validFrom(), equalTo(expectedRecord.timestamp)); assertThat(results.get(i).validTo(), equalTo(expectedValidTo)); i++; + index++; } // verify exception when timestamp is out of range