Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7AE98200BC3 for ; Fri, 14 Oct 2016 00:35:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7981C160AE4; Thu, 13 Oct 2016 22:35:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BFC01160AF6 for ; Fri, 14 Oct 2016 00:35:08 +0200 (CEST) Received: (qmail 35278 invoked by uid 500); 13 Oct 2016 22:34:53 -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 32801 invoked by uid 99); 13 Oct 2016 22:34:52 -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; Thu, 13 Oct 2016 22:34:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA8FBF0DBD; Thu, 13 Oct 2016 22:34:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aengineer@apache.org To: common-commits@hadoop.apache.org Date: Thu, 13 Oct 2016 22:35:38 -0000 Message-Id: In-Reply-To: <3a5c1b6a58b64f7f9ca44c08088316bf@git.apache.org> References: <3a5c1b6a58b64f7f9ca44c08088316bf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/51] [abbrv] hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." archived-at: Thu, 13 Oct 2016 22:35:09 -0000 Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit fdce515091f0a61ffd6c9ae464a68447dedf1124. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8c721aa0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8c721aa0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8c721aa0 Branch: refs/heads/HDFS-7240 Commit: 8c721aa00a47a976959e3861ddd742f09db432fc Parents: 332a61f Author: Andrew Wang Authored: Thu Oct 13 13:23:12 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:28 2016 -0700 ---------------------------------------------------------------------- .../blockmanagement/TestPendingInvalidateBlock.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8c721aa0/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); - DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 10000); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); - waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); - waitForNumPendingDeletionBlocks(0); + waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); - waitForNumPendingDeletionBlocks(0); + waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org