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 5D98B200BA6 for ; Tue, 18 Oct 2016 11:09:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5C50E160ADC; Tue, 18 Oct 2016 09:09:23 +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 A1805160ACC for ; Tue, 18 Oct 2016 11:09:22 +0200 (CEST) Received: (qmail 33460 invoked by uid 500); 18 Oct 2016 09:09:21 -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 33447 invoked by uid 99); 18 Oct 2016 09:09:21 -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, 18 Oct 2016 09:09:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8BB2FE02E4; Tue, 18 Oct 2016 09:09:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: drankye@apache.org To: common-commits@hadoop.apache.org Message-Id: <8dc1508b127b43ae80b09ec1c2310891@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDFS-10920. TestStorageMover#testNoSpaceDisk is failing intermittently. Contributed by Rakesh R Date: Tue, 18 Oct 2016 09:09:21 +0000 (UTC) archived-at: Tue, 18 Oct 2016 09:09:23 -0000 Repository: hadoop Updated Branches: refs/heads/branch-2 b2618685f -> 3972bb3bb HDFS-10920. TestStorageMover#testNoSpaceDisk is failing intermittently. Contributed by Rakesh R Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3972bb3b Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3972bb3b Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3972bb3b Branch: refs/heads/branch-2 Commit: 3972bb3bbabacc42b738590cd8815d216c5cbdd4 Parents: b261868 Author: Kai Zheng Authored: Tue Oct 18 15:08:15 2016 +0600 Committer: Kai Zheng Committed: Tue Oct 18 15:08:15 2016 +0600 ---------------------------------------------------------------------- .../hadoop/hdfs/server/mover/TestStorageMover.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/3972bb3b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java index 549dbc8..26032cf 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java @@ -641,8 +641,10 @@ public class TestStorageMover { } private void waitForAllReplicas(int expectedReplicaNum, Path file, - DistributedFileSystem dfs) throws Exception { - for (int i = 0; i < 5; i++) { + DistributedFileSystem dfs, int retryCount) throws Exception { + LOG.info("Waiting for replicas count " + expectedReplicaNum + + ", file name: " + file); + for (int i = 0; i < retryCount; i++) { LocatedBlocks lbs = dfs.getClient().getLocatedBlocks(file.toString(), 0, BLOCK_SIZE); LocatedBlock lb = lbs.get(0); @@ -692,7 +694,7 @@ public class TestStorageMover { for (int i = 0; i < 2; i++) { final Path p = new Path(pathPolicyMap.hot, "file" + i); DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L); - waitForAllReplicas(replication, p, test.dfs); + waitForAllReplicas(replication, p, test.dfs, 10); } // set all the DISK volume to full @@ -707,16 +709,17 @@ public class TestStorageMover { final Replication r = test.getReplication(file0); final short newReplication = (short) 5; test.dfs.setReplication(file0, newReplication); - Thread.sleep(10000); + waitForAllReplicas(newReplication, file0, test.dfs, 10); test.verifyReplication(file0, r.disk, newReplication - r.disk); // test creating a cold file and then increase replication final Path p = new Path(pathPolicyMap.cold, "foo"); DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L); + waitForAllReplicas(replication, p, test.dfs, 10); test.verifyReplication(p, 0, replication); test.dfs.setReplication(p, newReplication); - Thread.sleep(10000); + waitForAllReplicas(newReplication, p, test.dfs, 10); test.verifyReplication(p, 0, newReplication); //test move a hot file to warm @@ -750,7 +753,7 @@ public class TestStorageMover { for (int i = 0; i < 2; i++) { final Path p = new Path(pathPolicyMap.cold, "file" + i); DFSTestUtil.createFile(test.dfs, p, BLOCK_SIZE, replication, 0L); - waitForAllReplicas(replication, p, test.dfs); + waitForAllReplicas(replication, p, test.dfs, 10); } // set all the ARCHIVE volume to full @@ -767,7 +770,7 @@ public class TestStorageMover { final short newReplication = (short) 5; test.dfs.setReplication(file0, newReplication); - Thread.sleep(10000); + waitForAllReplicas(r.archive, file0, test.dfs, 10); test.verifyReplication(file0, 0, r.archive); } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org