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 A188A200D14 for ; Tue, 3 Oct 2017 23:23:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A0243160BD5; Tue, 3 Oct 2017 21:23:45 +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 E75B01609DE for ; Tue, 3 Oct 2017 23:23:44 +0200 (CEST) Received: (qmail 1884 invoked by uid 500); 3 Oct 2017 21:23:22 -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 819 invoked by uid 99); 3 Oct 2017 21:23: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, 03 Oct 2017 21:23:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 417F7F5843; Tue, 3 Oct 2017 21:23:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kkaranasos@apache.org To: common-commits@hadoop.apache.org Date: Tue, 03 Oct 2017 21:23:32 -0000 Message-Id: <4db9101f3a4741339bb9d1d280ea93cd@git.apache.org> In-Reply-To: <39eba03e94fd4c5b9ffdcae8c69f6563@git.apache.org> References: <39eba03e94fd4c5b9ffdcae8c69f6563@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/50] [abbrv] hadoop git commit: HDFS-12458. TestReencryptionWithKMS fails regularly. Contributed by Xiao Chen. archived-at: Tue, 03 Oct 2017 21:23:45 -0000 HDFS-12458. TestReencryptionWithKMS fails regularly. Contributed by Xiao Chen. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7c34ceaf Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7c34ceaf Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7c34ceaf Branch: refs/heads/YARN-6592 Commit: 7c34ceaf4fa28e2ecabd6626860bb1c7418e4b8d Parents: 28c4957 Author: Wei-Chiu Chuang Authored: Thu Sep 28 05:09:37 2017 -0700 Committer: Wei-Chiu Chuang Committed: Thu Sep 28 05:10:26 2017 -0700 ---------------------------------------------------------------------- .../hadoop/hdfs/server/namenode/TestReencryption.java | 13 +++++++------ .../hdfs/server/namenode/TestReencryptionHandler.java | 7 ++++--- 2 files changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c34ceaf/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryption.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryption.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryption.java index 33c52bf..4bf6aa4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryption.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryption.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; @@ -129,11 +128,9 @@ public class TestReencryption { conf.setInt(DFSConfigKeys.DFS_LIST_LIMIT, 3); // Adjust configs for re-encrypt test cases conf.setInt(DFSConfigKeys.DFS_NAMENODE_REENCRYPT_BATCH_SIZE_KEY, 5); - conf.setTimeDuration( - DFSConfigKeys.DFS_NAMENODE_REENCRYPT_SLEEP_INTERVAL_KEY, 1, - TimeUnit.SECONDS); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build(); cluster.waitActive(); + cluster.waitClusterUp(); fs = cluster.getFileSystem(); fsn = cluster.getNamesystem(); fsWrapper = new FileSystemTestWrapper(fs); @@ -1284,6 +1281,7 @@ public class TestReencryption { fsn = cluster.getNamesystem(); getEzManager().pauseReencryptForTesting(); cluster.waitActive(); + cluster.waitClusterUp(); } private void waitForReencryptedZones(final int expected) @@ -1519,6 +1517,7 @@ public class TestReencryption { getEzManager().pauseReencryptForTesting(); dfsAdmin.reencryptEncryptionZone(zone, ReencryptAction.START); waitForQueuedZones(1); + getEzManager().pauseReencryptUpdaterForTesting(); getEzManager().resumeReencryptForTesting(); LOG.info("Waiting for re-encrypt callables to run"); @@ -1529,7 +1528,6 @@ public class TestReencryption { } }, 100, 10000); - getEzManager().pauseReencryptUpdaterForTesting(); dfsAdmin.reencryptEncryptionZone(zone, ReencryptAction.CANCEL); // now resume updater and verify status. @@ -1609,7 +1607,7 @@ public class TestReencryption { cluster.getConfiguration(0) .unset(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH); cluster.restartNameNodes(); - cluster.waitActive(); + cluster.waitClusterUp(); // test re-encrypt should fail try { @@ -1673,6 +1671,9 @@ public class TestReencryption { } fs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE); + // trigger the background thread to run, without having to + // wait for DFS_NAMENODE_REENCRYPT_SLEEP_INTERVAL_KEY + getHandler().notifyNewSubmission(); waitForReencryptedFiles(zone.toString(), 10); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c34ceaf/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java index f0dd92c..e2035ed 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestReencryptionHandler.java @@ -101,9 +101,9 @@ public class TestReencryptionHandler { final StopWatch sw = new StopWatch().start(); rh.throttle(); sw.stop(); - assertTrue("should have throttled for at least 4 second", + assertTrue("should have throttled for at least 8 second", sw.now(TimeUnit.MILLISECONDS) > 8000); - assertTrue("should have throttled for at most 6 second", + assertTrue("should have throttled for at most 12 second", sw.now(TimeUnit.MILLISECONDS) < 12000); } @@ -191,7 +191,8 @@ public class TestReencryptionHandler { removeTaskThread.start(); rh.throttle(); sw.stop(); + LOG.info("Throttle completed, consumed {}", sw.now(TimeUnit.MILLISECONDS)); assertTrue("should have throttled for at least 3 second", - sw.now(TimeUnit.MILLISECONDS) > 3000); + sw.now(TimeUnit.MILLISECONDS) >= 3000); } } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org