Skip to content

Commit 761c2bc

Browse files
authored
Fix OnheapIncrementalIndexTest error expectation. (#18882)
The error message should expect minTimestampProjectionTimestamp, not outOfRangeProjectionTimestamp. These are out of sync on Jan 1. Also, now we use a specific timestamp rather than nowUtc, because using nowUtc would lead the test to fail if run at exactly midnight UTC.
1 parent 5fb5926 commit 761c2bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

processing/src/test/java/org/apache/druid/segment/incremental/OnheapIncrementalIndexTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ public void testTimestampOutOfRange()
418418
)
419419
.build();
420420

421-
final DateTime minTimestamp = DateTimes.nowUtc();
422-
final DateTime outOfRangeTimestamp = DateTimes.nowUtc().minusDays(1);
423-
final DateTime outOfRangeProjectionTimestamp = Granularities.YEAR.bucketStart(outOfRangeTimestamp);
421+
final DateTime minTimestamp = DateTimes.of("2001-01-01T01:00:00");
422+
final DateTime minTimestampProjectionTimestamp = Granularities.YEAR.bucketStart(minTimestamp);
423+
final DateTime outOfRangeTimestamp = minTimestamp.minusDays(1);
424424

425425
final IncrementalIndex index = IndexBuilder.create()
426426
.schema(IncrementalIndexSchema.builder()
@@ -502,7 +502,7 @@ public void testTimestampOutOfRange()
502502
"Cannot add row[{timestamp="
503503
+ minTimestamp
504504
+ ", event={string=hello, long=10}, dimensions=[string, long]}] to projection[proj] because projection effective timestamp["
505-
+ outOfRangeProjectionTimestamp
505+
+ minTimestampProjectionTimestamp
506506
+ "] is below the minTimestamp["
507507
+ minTimestamp + "]",
508508
t.getMessage()

0 commit comments

Comments
 (0)