adoroszlai commented on code in PR #5516: URL: https://github.com/apache/ozone/pull/5516#discussion_r1382402670
########## hadoop-hdds/server-scm/pom.xml: ########## @@ -165,6 +165,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> <artifactId>junit-jupiter-params</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.ozone</groupId> + <artifactId>hdds-test-utils</artifactId> + <scope>compile</scope> Review Comment: `hdds-test-utils` is for tests, should not be added in `compile` scope. This seems to be unnecessary, compiles fine without this. ########## hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestSCMNodeManager.java: ########## @@ -154,6 +160,10 @@ public class TestSCMNodeManager { private static final LayoutVersionProto CORRECT_LAYOUT_PROTO = toLayoutVersionProto(MAX_LV, MAX_LV); +// public TestSCMNodeManager() { +// this.clock = Clock.system(ZoneId.systemDefault()); Review Comment: It would be good to create as instance variable instead of in each test method. But should use `TestClock`, not `Clock.system()`. ########## hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java: ########## @@ -275,12 +278,15 @@ public List<DatanodeDetails> getNodes(NodeStatus status) { @Override public List<DatanodeDetails> getNodes( HddsProtos.NodeOperationalState opState, HddsProtos.NodeState nodestate) { + Instant initialInstant = Instant.now(); + ZoneId zoneId = ZoneId.systemDefault(); + TestClock testClock = new TestClock(initialInstant, zoneId); Review Comment: It would be nice to avoid duplicating these. Can you please try using `TestClock.newInstance()`? ########## hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestSCMNodeManager.java: ########## @@ -136,6 +140,8 @@ public class TestSCMNodeManager { private static final Logger LOG = LoggerFactory.getLogger(TestSCMNodeManager.class); +// @Mock +// private final Clock clock; Review Comment: Please remove dead code. -- 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]
