From common-commits-return-90077-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Oct 30 20:00:23 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id DA599180652 for ; Tue, 30 Oct 2018 20:00:22 +0100 (CET) Received: (qmail 68696 invoked by uid 500); 30 Oct 2018 19:00:13 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 67924 invoked by uid 99); 30 Oct 2018 19:00:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2018 19:00:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20175E11FA; Tue, 30 Oct 2018 19:00:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: inigoiri@apache.org To: common-commits@hadoop.apache.org Date: Tue, 30 Oct 2018 19:00:27 -0000 Message-Id: <8d6cdd713b0140a5a2376b45bc762bd4@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [17/50] [abbrv] hadoop git commit: HDFS-14029. Sleep in TestLazyPersistFiles should be put into a loop. Contributed by Adam Antal. HDFS-14029. Sleep in TestLazyPersistFiles should be put into a loop. Contributed by Adam Antal. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9b899f1e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9b899f1e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9b899f1e Branch: refs/heads/HDFS-13532 Commit: 9b899f1ebd5126a756fceb43459164165488b203 Parents: 34b2521 Author: Arpit Agarwal Authored: Thu Oct 25 15:14:13 2018 -0700 Committer: Arpit Agarwal Committed: Thu Oct 25 15:14:13 2018 -0700 ---------------------------------------------------------------------- .../fsdataset/impl/TestLazyPersistFiles.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/9b899f1e/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestLazyPersistFiles.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestLazyPersistFiles.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestLazyPersistFiles.java index 71a9f6f..04f8127 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestLazyPersistFiles.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestLazyPersistFiles.java @@ -151,7 +151,7 @@ public class TestLazyPersistFiles extends LazyPersistTestCase { /** * If NN restarted then lazyPersist files should not deleted */ - @Test + @Test(timeout = 20000) public void testFileShouldNotDiscardedIfNNRestarted() throws IOException, InterruptedException, TimeoutException { getClusterBuilder().setRamDiskReplicaCapacity(2).build(); @@ -165,13 +165,12 @@ public class TestLazyPersistFiles extends LazyPersistTestCase { cluster.restartNameNodes(); // wait for the redundancy monitor to mark the file as corrupt. - Thread.sleep(2 * DFS_NAMENODE_REDUNDANCY_INTERVAL_SECONDS_DEFAULT * 1000); - - Long corruptBlkCount = (long) Iterators.size(cluster.getNameNode() - .getNamesystem().getBlockManager().getCorruptReplicaBlockIterator()); - - // Check block detected as corrupted - assertThat(corruptBlkCount, is(1L)); + Long corruptBlkCount; + do { + Thread.sleep(DFS_NAMENODE_REDUNDANCY_INTERVAL_SECONDS_DEFAULT * 1000); + corruptBlkCount = (long) Iterators.size(cluster.getNameNode() + .getNamesystem().getBlockManager().getCorruptReplicaBlockIterator()); + } while (corruptBlkCount != 1L); // Ensure path1 exist. Assert.assertTrue(fs.exists(path1)); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org