adoroszlai commented on code in PR #8502:
URL: https://github.com/apache/hadoop/pull/8502#discussion_r3280918205


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java:
##########
@@ -118,11 +118,16 @@ public void testShutdown() throws Exception {
 
       // create files and make sure that first datanode will be down
       DataNode dn = cluster.getDataNodes().get(dnIndex);
+      long deadline = System.currentTimeMillis() + 60000;
       for (int i=0; dn.isDatanodeUp(); i++) {
+        if (System.currentTimeMillis() > deadline) {

Review Comment:
   Please use `Time.monotonicNow()` instead of `System.currentTimeMillis()`.



##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java:
##########
@@ -118,11 +118,16 @@ public void testShutdown() throws Exception {
 
       // create files and make sure that first datanode will be down
       DataNode dn = cluster.getDataNodes().get(dnIndex);
+      long deadline = System.currentTimeMillis() + 60000;
       for (int i=0; dn.isDatanodeUp(); i++) {
+        if (System.currentTimeMillis() > deadline) {
+            org.junit.jupiter.api.Assertions.fail("DataNode stayed UP for 60s 
despite Disk Errors.");

Review Comment:
   nit: please add import for `fail`



-- 
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]

Reply via email to