From 96defb2d7bac84e68267570cd53c8fa290e4f319 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Fri, 6 Jun 2014 21:42:40 +0000 Subject: [PATCH] HDFS-6487. TestStandbyCheckpoint#testSBNCheckpoints is racy. Contributed by Mit Desai. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1601017 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../server/namenode/ha/TestStandbyCheckpoints.java | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 1437b0fe646..ee89252e4d9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -153,6 +153,9 @@ Release 2.5.0 - UNRELEASED HDFS-6369. Document that BlockReader#available() can return more bytes than are remaining in the block (Ted Yu via Colin Patrick McCabe) + HDFS-6487. TestStandbyCheckpoint#testSBNCheckpoints is racy. + (Mit Desai via wang) + OPTIMIZATIONS HDFS-6214. Webhdfs has poor throughput for files >2GB (daryn) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java index fd579026e78..e9b91249c4c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java @@ -153,6 +153,18 @@ public class TestStandbyCheckpoints { // do a checkpoint and save one to its local directories. HATestUtil.waitForCheckpoint(cluster, 1, ImmutableList.of(12)); + GenericTestUtils.waitFor(new Supplier() { + @Override + public Boolean get() { + if(tmpOivImgDir.list().length > 0) { + return true; + } + else { + return false; + } + } + }, 1000, 60000); + // It should have saved the oiv image too. assertEquals("One file is expected", 1, tmpOivImgDir.list().length);