FrankChen021 commented on code in PR #19875:
URL: https://github.com/apache/druid/pull/19875#discussion_r3717603279
##########
extensions-core/testing-tools/src/test/java/org/apache/druid/query/expressions/SleepExprTest.java:
##########
@@ -59,10 +59,10 @@ private void assertTimeElapsed(String expression, long
expectedTimeElapsedMs)
expr.eval(InputBindings.nilBindings()).value();
final long after = System.currentTimeMillis();
final long elapsed = after - before;
- Assert.assertTrue(
- StringUtils.format("Expected [%s], but actual elapsed was [%s]",
expectedTimeElapsedMs, elapsed),
+ Assertions.assertTrue(
elapsed >= expectedTimeElapsedMs
- && elapsed < expectedTimeElapsedMs + detla
+ && elapsed < expectedTimeElapsedMs + detla,
+ StringUtils.format("Expected [%s], but actual elapsed was [%s]",
expectedTimeElapsedMs, elapsed)
Review Comment:
Addressed in commit `816c2b02cd`: renamed the tolerance variable from
`detla` to `deltaMs` in `SleepExprTest`. This is a readability-only change with
no behavior change.
Validation:
- `mvn -ntp test -pl extensions-core/testing-tools
-Dtest="org.apache.druid.query.expressions.SleepExprTest"
-Dsurefire.failIfNoSpecifiedTests=false -Pskip-static-checks
-Dweb.console.skip=true -T1` — 1 test, 0 failures.
- Checkstyle and SpotBugs passed for all three touched modules with 0
violations/errors.
##########
extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/BloomFilterGroupByQueryTest.java:
##########
@@ -97,15 +94,17 @@ public static Collection<?> constructorFeeder()
return constructors;
}
- @After
+ @AfterEach
public void teardown() throws IOException
{
helper.close();
}
Review Comment:
Addressed in commit `816c2b02cd`: `teardown()` now checks `helper != null`
before calling `close()`, so a setup failure cannot be replaced by a teardown
`NullPointerException`.
Validation:
- `mvn -ntp test -pl extensions-core/druid-bloom-filter
-Dtest="org.apache.druid.query.aggregation.bloom.BloomFilterGroupByQueryTest"
-Dsurefire.failIfNoSpecifiedTests=false -Pskip-static-checks
-Dweb.console.skip=true -T1` — 16 tests, 0 failures.
- Checkstyle and SpotBugs passed for all three touched modules with 0
violations/errors.
##########
extensions-core/ec2-extensions/src/test/java/org/apache/druid/indexing/overlord/autoscaling/ec2/EC2AutoScalerTest.java:
##########
@@ -119,13 +119,13 @@ public void testScale()
AutoScalingData created = autoScaler.provision();
- Assert.assertEquals(created.getNodeIds().size(), 1);
- Assert.assertEquals("theInstance", created.getNodeIds().get(0));
+ Assertions.assertEquals(created.getNodeIds().size(), 1);
+ Assertions.assertEquals("theInstance", created.getNodeIds().get(0));
AutoScalingData deleted =
autoScaler.terminate(Collections.singletonList("dummyIP"));
- Assert.assertEquals(deleted.getNodeIds().size(), 1);
- Assert.assertEquals(INSTANCE_ID, deleted.getNodeIds().get(0));
+ Assertions.assertEquals(deleted.getNodeIds().size(), 1);
+ Assertions.assertEquals(INSTANCE_ID, deleted.getNodeIds().get(0));
Review Comment:
Addressed in commit `816c2b02cd`: changed both node-count assertions to
`Assertions.assertEquals(expected, actual)`. The string assertions in this test
already used the expected, actual order.
Validation:
- `mvn -ntp test -pl extensions-core/ec2-extensions
-Dtest="org.apache.druid.indexing.overlord.autoscaling.ec2.EC2AutoScalerTest"
-Dsurefire.failIfNoSpecifiedTests=false -Pskip-static-checks
-Dweb.console.skip=true -T1` — 3 tests, 0 failures.
- Checkstyle and SpotBugs passed for all three touched modules with 0
violations/errors.
--
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]