diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java index 98bffd638a2..24aa1bebfda 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java @@ -1241,7 +1241,7 @@ public class TestDistributedFileSystem { return null; } }).when(injector).getHdfsBlocksMetadata(); - DataNodeFaultInjector.instance = injector; + DataNodeFaultInjector.set(injector); BlockStorageLocation[] locs = fs.getFileBlockStorageLocations(allLocs); for (BlockStorageLocation loc: locs) { @@ -1251,7 +1251,7 @@ public class TestDistributedFileSystem { } // Restore a default injector - DataNodeFaultInjector.instance = new DataNodeFaultInjector(); + DataNodeFaultInjector.set(new DataNodeFaultInjector()); // Stop a datanode to simulate a failure. DataNodeProperties stoppedNode = cluster.stopDataNode(0);