This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 80160e5412f HDFS-17920. Eliminate possible infinite loop in
TestDiskError.testShutdown (#8502)
80160e5412f is described below
commit 80160e5412fe07c08ef794ff90beeeed547f50d1
Author: boky01 <[email protected]>
AuthorDate: Tue May 26 12:36:22 2026 +0200
HDFS-17920. Eliminate possible infinite loop in TestDiskError.testShutdown
(#8502)
---
.../java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java
index 47588d4b2e5..b602b396b14 100644
---
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDiskError.java
@@ -19,6 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import java.io.DataOutputStream;
import java.io.File;
@@ -53,6 +54,7 @@
import org.apache.hadoop.hdfs.server.namenode.NameNodeAdapter;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.DataChecksum;
+import org.apache.hadoop.util.Time;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -118,11 +120,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 = Time.monotonicNow() + 60000;
for (int i=0; dn.isDatanodeUp(); i++) {
+ if (Time.monotonicNow() > deadline) {
+ fail("DataNode stayed UP for 60s despite Disk Errors.");
+ }
Path fileName = new Path("/test.txt"+i);
DFSTestUtil.createFile(fs, fileName, 1024, (short)2, 1L);
DFSTestUtil.waitReplication(fs, fileName, (short)2);
fs.delete(fileName, true);
+ Thread.sleep(200);
}
} finally {
// restore its old permission
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]