KAFKA-16689: Move LogValidatorTest to storage module#16167
KAFKA-16689: Move LogValidatorTest to storage module#16167chia7712 merged 30 commits intoapache:trunkfrom
Conversation
c968a9d to
07dda87
Compare
|
@chia7712 Please take look! Thanks. |
|
Hi @chia7712 , thanks for your review. |
Address below comments 1. replace time with Duration 2. Delete iterToStream 3. remove unused variable 4. Inline createNonIncreasingOffsetRecords
e725614 to
eb33904
Compare
…endency" This reverts commit 51bffc7.
| try { | ||
| record.ensureValid(); | ||
| } catch (InvalidRecordException e) { | ||
| } catch (InvalidRecordException | CorruptRecordException e) { |
There was a problem hiding this comment.
here is the exception should be thrown so we need to add it.
There was a problem hiding this comment.
My point was why we need to change the production code in this test migration?
There was a problem hiding this comment.
I can't enter recordInvalidChecksums if I don't have this modification.
There was a problem hiding this comment.
ok, it seems that is another issue.
#7150 changes the thrown exception from InvalidRecordException to CorruptRecordException, and so LogValidator can't catch it to update recordInvalidChecksums. Let me file a Jira for it
There was a problem hiding this comment.
@TaiJuWu I have assigned https://issues.apache.org/jira/browse/KAFKA-17104 to you
| } | ||
|
|
||
| @Test | ||
| public void testInvalidSequence() { |
There was a problem hiding this comment.
nice one. could you please use EnumSource to rewrite it? for example:
@ParameterizedTest
@EnumSource(CompressionType.class)
public void testInvalidSequenceV0(CompressionType type) {
checkInvalidSequence(RecordBatch.MAGIC_VALUE_V0, type);
}
@ParameterizedTest
@EnumSource(CompressionType.class)
public void testInvalidSequenceV1(CompressionType type) {
checkInvalidSequence(RecordBatch.MAGIC_VALUE_V2, type);
}
@ParameterizedTest
@EnumSource(CompressionType.class)
public void testInvalidSequenceV2(CompressionType type) {
checkInvalidSequence(RecordBatch.MAGIC_VALUE_V2, type);
}There was a problem hiding this comment.
Hi @chia7712 , Thanks for review and nice suggestions.
I rewrite this part, please take a look.
|
@TaiJuWu please fix the conflicts |
|
@TaiJuWu please rebase code to fix build error |
Done. |
|
@TaiJuWu Could you please merge trunk to fix those known failed tests? |
*More detailed description of your change,
Rewrite LogValidatorTest.scala to java version
*Summary of testing strategy (including rationale)
Committer Checklist (excluded from commit message)