falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rag...@apache.org
Subject incubator-falcon git commit: FALCON-895 Fix intermittent failures in ProcessInstanceStatus and KillsTest classes. Contributed by Paul Isaychuk
Date Thu, 04 Dec 2014 22:32:25 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master dcc282389 -> 56900a2b8


FALCON-895 Fix intermittent failures in ProcessInstanceStatus and KillsTest classes. Contributed
by Paul Isaychuk


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/56900a2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/56900a2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/56900a2b

Branch: refs/heads/master
Commit: 56900a2b860c257242e70bad7edbcd111528bfb3
Parents: dcc2823
Author: Raghav Kumar Gautam <raghav@apache.org>
Authored: Thu Dec 4 14:32:22 2014 -0800
Committer: Raghav Kumar Gautam <raghav@apache.org>
Committed: Thu Dec 4 14:32:22 2014 -0800

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  3 ++
 .../regression/ProcessInstanceKillsTest.java    | 37 ++++++++++++++------
 .../regression/ProcessInstanceStatusTest.java   |  1 +
 3 files changed, 31 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/56900a2b/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 6a1df5c..a0a1a7d 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -169,6 +169,9 @@ Trunk (Unreleased)
    FALCON-681 delete duplicate feed retention test from falcon regression (SamarthG)
 
   BUG FIXES
+   FALCON-895 Fix intermittent failures in ProcessInstanceStatus and KillsTest classes.
+   (Paul Isaychuk via Raghav Kumar Gautam)
+
    FALCON-891 Removing some more invalid acl tests (Raghav Kumar Gautam)
 
    FALCON-888 Disabling test for special chars in pipeline name and

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/56900a2b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
index 53054c61..e1a4dd4 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
@@ -35,6 +35,7 @@ import org.apache.falcon.resource.InstancesResult.WorkflowStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.log4j.Logger;
 import org.apache.oozie.client.CoordinatorAction;
+import org.apache.oozie.client.CoordinatorJob;
 import org.apache.oozie.client.OozieClient;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
@@ -45,6 +46,8 @@ import org.testng.annotations.Test;
 
 import java.io.IOException;
 import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Process instance kill tests.
@@ -136,26 +139,40 @@ public class ProcessInstanceKillsTest extends BaseTestClass {
     }
 
     /**
-     * Schedule process. Perform -kill action on instances between -start and -end dates
which
-     * expose range of last 3 instances which have been materialized already and those which
-     * should be. Check that only existent instances are killed.
+     * Schedule process. Provide data for all instances except the last,
+     * thus making it non-materialized (waiting). Try to -kill last 3 instances.
+     * Check that only running instances were affected.
      *
      * @throws Exception
      */
     @Test(groups = {"singleCluster"})
-    public void testProcessInstanceKillKillNonMaterialized() throws Exception {
-        bundles[0].setProcessValidity("2010-01-02T00:00Z", "2010-01-02T01:00Z");
+    public void testProcessInstanceKillKillNotRunning() throws Exception {
+        bundles[0].setProcessValidity("2010-01-02T00:00Z", "2010-01-02T00:26Z");
         bundles[0].setProcessTimeOut(3, TimeUnit.minutes);
-        bundles[0].setProcessPeriodicity(1, TimeUnit.minutes);
+        bundles[0].setProcessPeriodicity(5, TimeUnit.minutes);
+        bundles[0].setInputFeedPeriodicity(5, TimeUnit.minutes);
         bundles[0].setProcessConcurrency(6);
         bundles[0].submitFeedsScheduleProcess(prism);
         InstanceUtil.waitTillInstancesAreCreated(cluster, bundles[0].getProcessData(), 0);
-        OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
+
+        //create data for first 5 instances, 6th should be non-materialized
+        String bundleId = InstanceUtil.getSequenceBundleID(cluster, processName, EntityType.PROCESS,
0);
+        for(CoordinatorJob c : clusterOC.getBundleJobInfo(bundleId).getCoordinators()) {
+            List<CoordinatorAction> actions = clusterOC.getCoordJobInfo(c.getId()).getActions();
+            if (actions.size() == 6) {
+                for(int i = 0; i < 5; i++) {
+                    CoordinatorAction action = actions.get(i);
+                    InstanceUtil.createHDFSFolders(cluster, Arrays
+                        .asList(action.getMissingDependencies().split("#")));
+                }
+                break;
+            }
+        }
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 5,
-                CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
+                CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 3);
         InstancesResult r = prism.getProcessHelper()
-                .getProcessInstanceKill(processName, "?start=2010-01-02T00:03Z&end=2010-01-02T00:30Z");
-        InstanceUtil.validateResponse(r, 3, 0, 0, 0, 3);
+                .getProcessInstanceKill(processName, "?start=2010-01-02T00:14Z&end=2010-01-02T00:26Z");
+        InstanceUtil.validateResponse(r, 3, 0, 0, 1, 2);
         LOGGER.info(r.toString());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/56900a2b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
index 6f88103..91fbf29 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
@@ -121,6 +121,7 @@ public class ProcessInstanceStatusTest extends BaseTestClass {
         bundles[0].setProcessConcurrency(1);
         bundles[0].submitFeedsScheduleProcess(prism);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
+        InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1, Status.RUNNING,
EntityType.PROCESS);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
             "?start=2010-01-02T01:00Z&end=2010-01-02T10:20Z");
         InstanceUtil.validateSuccess(r, bundles[0], WorkflowStatus.RUNNING);


Mime
View raw message