From 6da670ce6a81819a1a82be52e939b3f821a76e21 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Fri, 2 Mar 2012 01:26:54 +0000 Subject: [PATCH] HDFS-3037. TestMulitipleNNDataBlockScanner#testBlockScannerAfterRestart is racy. Contributed by Aaron T. Myers. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1296016 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hdfs/server/datanode/TestMulitipleNNDataBlockScanner.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index f654f33c64d..e62932cc87d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -121,6 +121,9 @@ Trunk (unreleased changes) HDFS-2908. Add apache license header for StorageReport.java. (Brandon Li via jitendra) + HDFS-3037. TestMulitipleNNDataBlockScanner#testBlockScannerAfterRestart is + racy. (atm) + Release 0.23.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestMulitipleNNDataBlockScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestMulitipleNNDataBlockScanner.java index 1b9a19c6499..68626282630 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestMulitipleNNDataBlockScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestMulitipleNNDataBlockScanner.java @@ -146,6 +146,9 @@ public class TestMulitipleNNDataBlockScanner { cluster.waitActive(); DataNode dn = cluster.getDataNodes().get(0); for (int i = 0; i < 3; i++) { + while (!dn.blockScanner.isInitialized(bpids[i])) { + Thread.sleep(1000); + } long blocksScanned = 0; while (blocksScanned != 20) { if (dn.blockScanner != null) {