Copilot commented on code in PR #19926:
URL: https://github.com/apache/druid/pull/19926#discussion_r3738722229
##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/IngestionTestBase.java:
##########
@@ -468,7 +475,8 @@ public ListenableFuture<TaskStatus> run(Task task)
lockbox.add(task);
taskStorage.insert(task, TaskStatus.running(task.getId()));
taskActionClient = createActionClient(task);
- taskReportsFile = temporaryFolder.newFile(
+ taskReportsFile = new File(
+ temporaryFolder,
StringUtils.format("ingestionTestBase-%s.json",
System.currentTimeMillis())
);
Review Comment:
`getReports()` reads from `reportsFile`, but the task execution path writes
reports to `taskReportsFile` via `SingleFileTaskReportFileWriter`. As a result,
callers like `getIngestionReports()` can end up reading a file that was never
written. Consider pointing `reportsFile` at the generated `taskReportsFile` so
the read side matches the write side.
##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/ShardSpecsTest.java:
##########
@@ -84,7 +84,7 @@ public void testShardSpecSelectionWithNullPartitionDimension()
ShardSpec spec4 =
shardSpecs.getShardSpec(Intervals.of("2014-01-01T00:00:00.000Z/2014-01-02T00:00:00.000Z"),
row2);
ShardSpec spec5 =
shardSpecs.getShardSpec(Intervals.of("2014-01-01T00:00:00.000Z/2014-01-02T00:00:00.000Z"),
row3);
- Assert.assertSame(true, spec3 == spec4);
- Assert.assertSame(false, spec3 == spec5);
+ Assertions.assertSame(true, spec3 == spec4);
+ Assertions.assertSame(false, spec3 == spec5);
Review Comment:
`assertSame(true, ...)` / `assertSame(false, ...)` is the wrong assertion
here: `assertSame` checks reference identity, not boolean truthiness. Since
you’re comparing `ShardSpec` instances, assert on the objects directly (or use
`assertTrue`/`assertFalse`).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]