hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [1/5] hadoop git commit: HADOOP-15454. TestRollingFileSystemSinkWithLocal fails on Windows. Contributed by Xiao Liang.
Date Thu, 10 May 2018 16:43:38 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 a756d3e7c -> ed592a210
  refs/heads/branch-2.9 212633737 -> 019ba5998
  refs/heads/branch-3.0 d72a4b630 -> 054a17387
  refs/heads/branch-3.1 ad4d4153d -> f4f291282
  refs/heads/trunk c8b53c436 -> 1da8d4190


HADOOP-15454. TestRollingFileSystemSinkWithLocal fails on Windows. Contributed by Xiao Liang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1da8d419
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1da8d419
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1da8d419

Branch: refs/heads/trunk
Commit: 1da8d4190d6e574347ab9d3380513e9401569573
Parents: c8b53c4
Author: Inigo Goiri <inigoiri@apache.org>
Authored: Thu May 10 09:41:16 2018 -0700
Committer: Inigo Goiri <inigoiri@apache.org>
Committed: Thu May 10 09:41:16 2018 -0700

----------------------------------------------------------------------
 .../sink/TestRollingFileSystemSinkWithLocal.java | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1da8d419/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSinkWithLocal.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSinkWithLocal.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSinkWithLocal.java
index 96306bf..1a69c8d 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSinkWithLocal.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSinkWithLocal.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.metrics2.sink;
 
+import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.metrics2.MetricsSystem;
 
 import org.junit.Test;
@@ -36,7 +37,7 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testWrite() throws Exception {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
     MetricsSystem ms = initMetricsSystem(path, false, false);
 
     assertMetricsContents(doWriteTest(ms, path, 1));
@@ -49,7 +50,7 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testSilentWrite() throws Exception {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
     MetricsSystem ms = initMetricsSystem(path, true, false);
 
     assertMetricsContents(doWriteTest(ms, path, 1));
@@ -62,7 +63,7 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testExistingWrite() throws Exception {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
 
     assertMetricsContents(doAppendTest(path, false, false, 2));
   }
@@ -75,7 +76,7 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testExistingWrite2() throws Exception {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
     MetricsSystem ms = initMetricsSystem(path, false, false);
 
     preCreateLogFile(path, 2);
@@ -91,7 +92,7 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testSilentExistingWrite() throws Exception {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
 
     assertMetricsContents(doAppendTest(path, false, false, 2));
   }
@@ -101,12 +102,12 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testFailedWrite() {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
     MetricsSystem ms = initMetricsSystem(path, false, false);
 
     new MyMetrics1().registerWith(ms);
 
-    methodDir.setWritable(false);
+    assertTrue(FileUtil.setWritable(methodDir, false));
     MockSink.errored = false;
 
     try {
@@ -130,12 +131,12 @@ public class TestRollingFileSystemSinkWithLocal
    */
   @Test
   public void testSilentFailedWrite() {
-    String path = methodDir.getAbsolutePath();
+    String path = methodDir.toURI().toString();
     MetricsSystem ms = initMetricsSystem(path, true, false);
 
     new MyMetrics1().registerWith(ms);
 
-    methodDir.setWritable(false);
+    assertTrue(FileUtil.setWritable(methodDir, false));
     MockSink.errored = false;
 
     try {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message