diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java index 498d785b64..35a9c2c7f4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java @@ -1638,6 +1638,11 @@ private void doTestBalancerWithStripedFile(Configuration conf) throws Exception BalancerParameters p = BalancerParameters.DEFAULT; runBalancer(conf, totalUsedSpace, totalCapacity, p, 0); + // namenode will ask datanode to delete replicas in heartbeat response + cluster.triggerHeartbeats(); + // namenode will update block locations according to the report + cluster.triggerDeletionReports(); + // verify locations of striped blocks locatedBlocks = client.getBlockLocations(fileName, 0, fileLen); StripedFileTestUtil.verifyLocatedStripedBlocks(locatedBlocks, groupSize);