MINOR: Fix the tests in LogValidatorTest (#20093)
CI / build (push) Waiting to run Details

Fix incorrect tests introduced in the refactor

5b9cbcf886

Reviewers: TaiJuWu <tjwu1217@gmail.com>, Ken Huang <s7133700@gmail.com>,
Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Jhen-Yung Hsu 2025-07-03 19:04:43 +08:00 committed by GitHub
parent 268cf664c3
commit 2e3ddb22ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -361,7 +361,7 @@ public class LogValidatorTest {
assertTrue(batch.isValid());
assertEquals(TimestampType.CREATE_TIME, batch.timestampType());
maybeCheckBaseTimestamp(timestampSeq.get(0), batch);
assertEquals(batch.maxTimestamp(), batch.maxTimestamp());
assertEquals(batch.maxTimestamp(), TestUtils.toList(batch).stream().map(Record::timestamp).max(Long::compare).get());
assertEquals(producerEpoch, batch.producerEpoch());
assertEquals(producerId, batch.producerId());
assertEquals(baseSequence, batch.baseSequence());
@ -552,7 +552,7 @@ public class LogValidatorTest {
assertTrue(batch.isValid());
assertEquals(batch.timestampType(), TimestampType.CREATE_TIME);
maybeCheckBaseTimestamp(timestampSeq.get(0), batch);
assertEquals(batch.maxTimestamp(), batch.maxTimestamp());
assertEquals(batch.maxTimestamp(), TestUtils.toList(batch).stream().map(Record::timestamp).max(Long::compare).get());
assertEquals(producerEpoch, batch.producerEpoch());
assertEquals(producerId, batch.producerId());
assertEquals(baseSequence, batch.baseSequence());
@ -1805,7 +1805,7 @@ public class LogValidatorTest {
assertTrue(batch.isValid());
assertEquals(TimestampType.CREATE_TIME, batch.timestampType());
maybeCheckBaseTimestamp(timestampSeq[0], batch);
assertEquals(batch.maxTimestamp(), batch.maxTimestamp());
assertEquals(batch.maxTimestamp(), TestUtils.toList(batch).stream().map(Record::timestamp).max(Long::compare).get());
assertEquals(producerEpoch, batch.producerEpoch());
assertEquals(producerId, batch.producerId());