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 08CEF200D5B for ; Tue, 28 Nov 2017 22:47:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 077A9160BE7; Tue, 28 Nov 2017 21:47:22 +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 56C19160C15 for ; Tue, 28 Nov 2017 22:47:21 +0100 (CET) Received: (qmail 84090 invoked by uid 500); 28 Nov 2017 21:47:20 -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 83936 invoked by uid 99); 28 Nov 2017 21:47:19 -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, 28 Nov 2017 21:47:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 90247F6024; Tue, 28 Nov 2017 21:47:19 +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, 28 Nov 2017 21:47:31 -0000 Message-Id: <36bb0af8290f416b9f4d345a615b01e2@git.apache.org> In-Reply-To: <7246f4abfe7d4e1b850d697f7cf2a998@git.apache.org> References: <7246f4abfe7d4e1b850d697f7cf2a998@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [13/50] [abbrv] hadoop git commit: MAPREDUCE-7011. TestClientDistributedCacheManager::testDetermineCacheVisibilities assumes all parent dirs set other exec archived-at: Tue, 28 Nov 2017 21:47:22 -0000 MAPREDUCE-7011. TestClientDistributedCacheManager::testDetermineCacheVisibilities assumes all parent dirs set other exec Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/782ba3bf Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/782ba3bf Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/782ba3bf Branch: refs/heads/YARN-6592 Commit: 782ba3bf9da52699b27405a3f147464975d1df99 Parents: 03c311e Author: Chris Douglas Authored: Tue Nov 21 20:42:28 2017 -0800 Committer: Chris Douglas Committed: Tue Nov 21 20:42:28 2017 -0800 ---------------------------------------------------------------------- .../TestClientDistributedCacheManager.java | 28 +++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/782ba3bf/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/filecache/TestClientDistributedCacheManager.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/filecache/TestClientDistributedCacheManager.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/filecache/TestClientDistributedCacheManager.java index b427f39..a61e938 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/filecache/TestClientDistributedCacheManager.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/filecache/TestClientDistributedCacheManager.java @@ -34,12 +34,15 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.io.SequenceFile.CompressionType; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.MRJobConfig; + import org.junit.After; -import org.junit.Assert; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -97,15 +100,15 @@ public class TestClientDistributedCacheManager { FileStatus firstStatus = statCache.get(firstCacheFile.toUri()); FileStatus secondStatus = statCache.get(secondCacheFile.toUri()); - Assert.assertNotNull(firstCacheFile + " was not found in the stats cache", + assertNotNull(firstCacheFile + " was not found in the stats cache", firstStatus); - Assert.assertNotNull(secondCacheFile + " was not found in the stats cache", + assertNotNull(secondCacheFile + " was not found in the stats cache", secondStatus); - Assert.assertEquals("Missing/extra entries found in the stas cache", + assertEquals("Missing/extra entries found in the stats cache", 2, statCache.size()); String expected = firstStatus.getModificationTime() + "," + secondStatus.getModificationTime(); - Assert.assertEquals(expected, jobConf.get(MRJobConfig.CACHE_FILE_TIMESTAMPS)); + assertEquals(expected, jobConf.get(MRJobConfig.CACHE_FILE_TIMESTAMPS)); job = Job.getInstance(conf); job.addCacheFile(new Path(TEST_VISIBILITY_CHILD_DIR, "*").toUri()); @@ -115,12 +118,12 @@ public class TestClientDistributedCacheManager { FileStatus thirdStatus = statCache.get(TEST_VISIBILITY_CHILD_DIR.toUri()); - Assert.assertEquals("Missing/extra entries found in the stas cache", + assertEquals("Missing/extra entries found in the stats cache", 1, statCache.size()); - Assert.assertNotNull(TEST_VISIBILITY_CHILD_DIR + assertNotNull(TEST_VISIBILITY_CHILD_DIR + " was not found in the stats cache", thirdStatus); expected = Long.toString(thirdStatus.getModificationTime()); - Assert.assertEquals("Incorrect timestamp for " + TEST_VISIBILITY_CHILD_DIR, + assertEquals("Incorrect timestamp for " + TEST_VISIBILITY_CHILD_DIR, expected, jobConf.get(MRJobConfig.CACHE_FILE_TIMESTAMPS)); } @@ -141,6 +144,11 @@ public class TestClientDistributedCacheManager { job.addCacheFile(relativePath.toUri()); jobConf = job.getConfiguration(); + // skip test if scratch dir is not PUBLIC + assumeTrue(TEST_VISIBILITY_PARENT_DIR + " is not public", + ClientDistributedCacheManager.isPublic( + jobConf, TEST_VISIBILITY_PARENT_DIR.toUri(), statCache)); + ClientDistributedCacheManager.determineCacheVisibilities(jobConf, statCache); // We use get() instead of getBoolean() so we can tell the difference --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org