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 ff7820abd2e..49d7a7ea97b 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 @@ -1687,6 +1687,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);