pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1424571 - in /pig/branches/branch-0.11: 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:27:20 GMT
Author: daijy
Date: Thu Dec 20 16:27:20 2012
New Revision: 1424571

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

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

Modified: pig/branches/branch-0.11/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/CHANGES.txt?rev=1424571&r1=1424570&r2=1424571&view=diff
==============================================================================
--- pig/branches/branch-0.11/CHANGES.txt (original)
+++ pig/branches/branch-0.11/CHANGES.txt Thu Dec 20 16:27:20 2012
@@ -531,6 +531,8 @@ Release 0.10.1 - Unreleased
 
 BUG FIXES
 
+PIG-3099: Pig unit test fixes for TestGrunt(1), TestStore(2), TestEmptyInputDir(3) (vikram.dixit
via daijy)
+
 PIG-3045: Specifying sorting field(s) at nightly.conf - fix sortArgs (rohini via cheolsoo)
 
 PIG-2953: "which" utility does not exist on Windows (daijy)

Modified: pig/branches/branch-0.11/test/org/apache/pig/test/TestEmptyInputDir.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/test/org/apache/pig/test/TestEmptyInputDir.java?rev=1424571&r1=1424570&r2=1424571&view=diff
==============================================================================
--- pig/branches/branch-0.11/test/org/apache/pig/test/TestEmptyInputDir.java (original)
+++ pig/branches/branch-0.11/test/org/apache/pig/test/TestEmptyInputDir.java Thu Dec 20 16:27:20
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.11/test/org/apache/pig/test/TestGrunt.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/test/org/apache/pig/test/TestGrunt.java?rev=1424571&r1=1424570&r2=1424571&view=diff
==============================================================================
--- pig/branches/branch-0.11/test/org/apache/pig/test/TestGrunt.java (original)
+++ pig/branches/branch-0.11/test/org/apache/pig/test/TestGrunt.java Thu Dec 20 16:27:20 2012
@@ -1073,10 +1073,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());

Modified: pig/branches/branch-0.11/test/org/apache/pig/test/TestStore.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/test/org/apache/pig/test/TestStore.java?rev=1424571&r1=1424570&r2=1424571&view=diff
==============================================================================
--- pig/branches/branch-0.11/test/org/apache/pig/test/TestStore.java (original)
+++ pig/branches/branch-0.11/test/org/apache/pig/test/TestStore.java Thu Dec 20 16:27:20 2012
@@ -408,7 +408,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);
@@ -530,7 +530,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.11/test/org/apache/pig/test/Util.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/test/org/apache/pig/test/Util.java?rev=1424571&r1=1424570&r2=1424571&view=diff
==============================================================================
--- pig/branches/branch-0.11/test/org/apache/pig/test/Util.java (original)
+++ pig/branches/branch-0.11/test/org/apache/pig/test/Util.java Thu Dec 20 16:27:20 2012
@@ -1186,9 +1186,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