HDFS-16884. Fix TestFsDatasetImpl#testConcurrentWriteAndDeleteBlock failed (#5280)

Reviewed-by: Takanobu Asanuma <tasanuma@apache.org>
Signed-off-by: Tao Li <tomscut@apache.org>
This commit is contained in:
huhaiyang 2023-01-11 09:12:26 +08:00 committed by GitHub
parent 4cf304de45
commit e3b09b7512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -662,6 +662,9 @@ public class TestFsDatasetImpl {
for (Future<?> f : futureList) { for (Future<?> f : futureList) {
f.get(); f.get();
} }
// Wait for the async deletion task finish.
GenericTestUtils.waitFor(() -> dataset.asyncDiskService.countPendingDeletions() == 0,
100, 10000);
for (String bpid : dataset.volumeMap.getBlockPoolList()) { for (String bpid : dataset.volumeMap.getBlockPoolList()) {
assertEquals(numBlocks / 2, dataset.volumeMap.size(bpid)); assertEquals(numBlocks / 2, dataset.volumeMap.size(bpid));
} }