pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1424569 - in /pig/branches/branch-0.10: CHANGES.txt test/org/apache/pig/test/TestEmptyInputDir.java test/org/apache/pig/test/TestGrunt.java test/org/apache/pig/test/TestStore.java test/org/apache/pig/test/Util.java
Date Thu, 20 Dec 2012 16:25:23 GMT
Author: daijy
Date: Thu Dec 20 16:25:23 2012
New Revision: 1424569

URL: http://svn.apache.org/viewvc?rev=1424569&view=rev
Log:
Pig unit test fixes for TestGrunt(1), TestStore(2), TestEmptyInputDir(3)

Modified:
    pig/branches/branch-0.10/CHANGES.txt
    pig/branches/branch-0.10/test/org/apache/pig/test/TestEmptyInputDir.java
    pig/branches/branch-0.10/test/org/apache/pig/test/TestGrunt.java
    pig/branches/branch-0.10/test/org/apache/pig/test/TestStore.java
    pig/branches/branch-0.10/test/org/apache/pig/test/Util.java

Modified: pig/branches/branch-0.10/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/CHANGES.txt?rev=1424569&r1=1424568&r2=1424569&view=diff
==============================================================================
--- pig/branches/branch-0.10/CHANGES.txt (original)
+++ pig/branches/branch-0.10/CHANGES.txt Thu Dec 20 16:25:23 2012
@@ -38,6 +38,8 @@ PIG-2727: PigStorage Source tagging does
 
 BUG FIXES
 
+PIG-3099: Pig unit test fixes for TestGrunt(1), TestStore(2), TestEmptyInputDir(3)
+
 PIG-3035: With latest version of hadoop23 pig does not return the correct exception stack
trace from backend (rohini)
 
 PIG-2953: "which" utility does not exist on Windows (daijy)

Modified: pig/branches/branch-0.10/test/org/apache/pig/test/TestEmptyInputDir.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/test/org/apache/pig/test/TestEmptyInputDir.java?rev=1424569&r1=1424568&r2=1424569&view=diff
==============================================================================
--- pig/branches/branch-0.10/test/org/apache/pig/test/TestEmptyInputDir.java (original)
+++ pig/branches/branch-0.10/test/org/apache/pig/test/TestEmptyInputDir.java Thu Dec 20 16:25:23
2012
@@ -82,7 +82,7 @@ public class TestEmptyInputDir {
             JobStats js = (JobStats)stats.getJobGraph().getSources().get(0);
             
             // This assert fails on 205 due to MAPREDUCE-3606
-            if (!Util.isHadoop205()&&!Util.isHadoop1_0())
+            if (!Util.isHadoop205()&&!Util.isHadoop1_x())
                 assertEquals(0, js.getNumberMaps()); 
             
             FileSystem fs = cluster.getFileSystem();
@@ -115,7 +115,7 @@ public class TestEmptyInputDir {
             JobStats js = (JobStats)stats.getJobGraph().getSources().get(0);
             
             // This assert fails on 205 due to MAPREDUCE-3606
-            if (!Util.isHadoop205()&&!Util.isHadoop1_0())
+            if (!Util.isHadoop205()&&!Util.isHadoop1_x())
                 assertEquals(0, js.getNumberMaps()); 
             
             FileSystem fs = cluster.getFileSystem();
@@ -149,7 +149,7 @@ public class TestEmptyInputDir {
             JobStats js = (JobStats)stats.getJobGraph().getSources().get(0);
             
             // This assert fails on 205 due to MAPREDUCE-3606
-            if (!Util.isHadoop205()&&!Util.isHadoop1_0())
+            if (!Util.isHadoop205()&&!Util.isHadoop1_x())
                 assertEquals(0, js.getNumberMaps()); 
             
             FileSystem fs = cluster.getFileSystem();

Modified: pig/branches/branch-0.10/test/org/apache/pig/test/TestGrunt.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/test/org/apache/pig/test/TestGrunt.java?rev=1424569&r1=1424568&r2=1424569&view=diff
==============================================================================
--- pig/branches/branch-0.10/test/org/apache/pig/test/TestGrunt.java (original)
+++ pig/branches/branch-0.10/test/org/apache/pig/test/TestGrunt.java Thu Dec 20 16:25:23 2012
@@ -1078,10 +1078,14 @@ public class TestGrunt {
             assertFalse(new File("tempShFileToTestShCommand").exists());
 
             if (Util.WINDOWS) {
-               strCmd = "sh echo foo > TouchedFileInsideGrunt_61 | dir /B | findstr TouchedFileInsideGrunt_61
> fileContainingTouchedFileInsideGruntShell_71";
+               //FIXME
+               // We need to fix this because there is a race condition with pipes. 
+               // dir command can potentially run before the TouchedFileInsideGrunt_61 is
written
+               // Solved for linux/unix below using xargs
+               strCmd = "sh echo foo > TouchedFileInsideGrunt_61 | dir /B | findstr TouchedFileInsideGrunt_61
> fileContainingTouchedFileInsideGruntShell_71"; 
             }
             else {
-               strCmd = "sh touch TouchedFileInsideGrunt_61 | ls | grep TouchedFileInsideGrunt_61
> fileContainingTouchedFileInsideGruntShell_71";
+               strCmd = "sh touch TouchedFileInsideGrunt_61 | xargs ls | grep TouchedFileInsideGrunt_61
> fileContainingTouchedFileInsideGruntShell_71";
             }
             cmd = new ByteArrayInputStream(strCmd.getBytes());
             reader = new InputStreamReader(cmd);

Modified: pig/branches/branch-0.10/test/org/apache/pig/test/TestStore.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/test/org/apache/pig/test/TestStore.java?rev=1424569&r1=1424568&r2=1424569&view=diff
==============================================================================
--- pig/branches/branch-0.10/test/org/apache/pig/test/TestStore.java (original)
+++ pig/branches/branch-0.10/test/org/apache/pig/test/TestStore.java Thu Dec 20 16:25:23 2012
@@ -403,7 +403,7 @@ public class TestStore extends junit.fra
                     Properties props = new Properties();                                
         
                     props.setProperty(MapRedUtil.FILE_SYSTEM_NAME, "file:///");
                     ps = new PigServer(ExecType.LOCAL, props);
-                    if (Util.isHadoop1_0()) {
+                    if (Util.isHadoop1_x()) {
                         // MAPREDUCE-1447/3563 (LocalJobRunner does not call methods of mapreduce
                         // OutputCommitter) is fixed only in 0.23.1
                         filesToVerify.put(DummyOutputCommitter.FILE_SETUPJOB_CALLED, Boolean.FALSE);
@@ -525,7 +525,7 @@ public class TestStore extends junit.fra
                     // LocalJobRunner does not call abortTask
                     filesToVerify.put(DummyOutputCommitter.FILE_ABORTTASK_CALLED + "1", Boolean.FALSE);
                     filesToVerify.put(DummyOutputCommitter.FILE_ABORTTASK_CALLED + "2", Boolean.FALSE);
-                    if (Util.isHadoop1_0()) {
+                    if (Util.isHadoop1_x()) {
                         // MAPREDUCE-1447/3563 (LocalJobRunner does not call methods of mapreduce
                         // OutputCommitter) is fixed only in 0.23.1
                         filesToVerify.put(DummyOutputCommitter.FILE_SETUPJOB_CALLED + "1",
Boolean.FALSE);

Modified: pig/branches/branch-0.10/test/org/apache/pig/test/Util.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/test/org/apache/pig/test/Util.java?rev=1424569&r1=1424568&r2=1424569&view=diff
==============================================================================
--- pig/branches/branch-0.10/test/org/apache/pig/test/Util.java (original)
+++ pig/branches/branch-0.10/test/org/apache/pig/test/Util.java Thu Dec 20 16:25:23 2012
@@ -1194,9 +1194,9 @@ public class Util {
         return false;
     }
     
-    public static boolean isHadoop1_0() {
+    public static boolean isHadoop1_x() {
         String version = org.apache.hadoop.util.VersionInfo.getVersion();
-        if (version.matches("\\b1\\.0\\..+"))
+        if (version.matches("\\b1\\.*\\..+"))
             return true;
         return false;
     }



Mime
View raw message