jackjlli commented on a change in pull request #4368: 3891: Check for validity
of segment start/end time during segment generation
URL: https://github.com/apache/incubator-pinot/pull/4368#discussion_r302773071
##########
File path:
pinot-core/src/test/java/org/apache/pinot/core/segment/index/creator/SegmentGenerationWithTimeColumnTest.java
##########
@@ -81,12 +84,25 @@ public void testSimpleDateSegmentGeneration()
public void testEpochDateSegmentGeneration()
throws Exception {
Schema schema = createSchema(false);
- File segmentDir = buildSegment(schema, false);
+ File segmentDir = buildSegment(schema, false, false);
SegmentMetadataImpl metadata =
SegmentDirectory.loadSegmentMetadata(segmentDir);
Assert.assertEquals(metadata.getStartTime(), minTime);
Assert.assertEquals(metadata.getEndTime(), maxTime);
}
+ @Test
+ public void testSegmentGenerationWithInvalidTime() {
+ boolean error = false;
+ try {
+ Schema schema = createSchema(false);
+ buildSegment(schema, false, true);
Review comment:
I think it's ok not to have assertion on the content of the exception; if
the exception message changes in the future we'll still need to modify all the
checks here. You can just write the code like this:
```
try {
blabla();
Assert.fail("...");
} catch (Exception e) {
// Expected.
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]