From e3b09b751234ddd0635e6ae90280700a81a371fe Mon Sep 17 00:00:00 2001 From: huhaiyang Date: Wed, 11 Jan 2023 09:12:26 +0800 Subject: [PATCH] HDFS-16884. Fix TestFsDatasetImpl#testConcurrentWriteAndDeleteBlock failed (#5280) Reviewed-by: Takanobu Asanuma Signed-off-by: Tao Li --- .../hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java index 9f2425d937..d6f42f3d02 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java @@ -662,6 +662,9 @@ public void run() { for (Future f : futureList) { f.get(); } + // Wait for the async deletion task finish. + GenericTestUtils.waitFor(() -> dataset.asyncDiskService.countPendingDeletions() == 0, + 100, 10000); for (String bpid : dataset.volumeMap.getBlockPoolList()) { assertEquals(numBlocks / 2, dataset.volumeMap.size(bpid)); }