falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rag...@apache.org
Subject git commit: FALCON-863 Fix tests to have start as well as end time for kill, rerun etc requests. Contributed by Raghav Kumar Gautam
Date Wed, 05 Nov 2014 17:33:07 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master 8fc5ff611 -> ad0979e72


FALCON-863 Fix tests to have start as well as end time for kill, rerun etc requests. Contributed
by Raghav Kumar Gautam


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

Branch: refs/heads/master
Commit: ad0979e7224d879efcb70f1f6d20ae34be6326b7
Parents: 8fc5ff6
Author: Raghav Kumar Gautam <raghav@apache.org>
Authored: Wed Nov 5 09:33:02 2014 -0800
Committer: Raghav Kumar Gautam <raghav@apache.org>
Committed: Wed Nov 5 09:33:02 2014 -0800

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                      |  3 +++
 .../falcon/regression/core/util/InstanceUtil.java  |  2 +-
 .../regression/ProcessInstanceKillsTest.java       | 14 +++++++++-----
 .../regression/ProcessInstanceRerunTest.java       |  9 ++++++---
 .../regression/ProcessInstanceResumeTest.java      | 17 +++++++++--------
 .../regression/ProcessInstanceSuspendTest.java     |  7 ++++---
 6 files changed, 32 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/ad0979e7/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 0f88e29..780d084 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -30,6 +30,9 @@ Trunk (Unreleased)
    via Samarth Gupta)
 
   IMPROVEMENTS
+   FALCON-863 Fix tests to have start as well as end time for kill, rerun etc
+   requests (Raghav Kumar Gautam)
+
    FALCON-856 Handle JsonSyntaxException in hitUrl (Ruslan Ostafiychuk)
 
    FALCON-847 Issue with login from keytab in merlin (Raghav Kumar Gautam)

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/ad0979e7/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java
index b70e112..4c60be7 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java
@@ -160,7 +160,7 @@ public final class InstanceUtil {
         if (jsonString.contains("(PROCESS) not found")) {
             r.setStatusCode(ResponseKeys.PROCESS_NOT_FOUND);
             return r;
-        } else if (jsonString.contains("Parameter start is empty")
+        } else if (jsonString.contains("Start and End dates cannot be empty for Instance
POST apis")
                 || jsonString.contains("Unparseable date:")) {
             r.setStatusCode(ResponseKeys.UNPARSEABLE_DATE);
             return r;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/ad0979e7/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 17ffa64..6c92711 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
@@ -106,8 +106,9 @@ public class ProcessInstanceKillsTest extends BaseTestClass {
         bundles[0].submitFeedsScheduleProcess(prism);
         InstanceUtil.waitTillInstancesAreCreated(cluster, bundles[0].getProcessData(), 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
+        TimeUtil.sleepSeconds(30);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceKill(processName,
-                "?start=2010-01-02T01:00Z");
+                "?start=2010-01-02T01:00Z&end=2010-01-02T01:01Z");
         InstanceUtil.validateSuccess(r, bundles[0], WorkflowStatus.KILLED);
     }
 
@@ -248,7 +249,8 @@ public class ProcessInstanceKillsTest extends BaseTestClass {
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 5,
                 CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 10);
-        prism.getProcessHelper().getProcessInstanceKill(processName, "?start=2010-01-02T01:20Z");
+        prism.getProcessHelper().getProcessInstanceKill(processName,
+                "?start=2010-01-02T01:20Z&end=2010-01-02T01:21Z");
         InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
                 "?start=2010-01-02T01:00Z&end=2010-01-02T01:21Z");
         InstanceUtil.validateResponse(r, 5, 4, 0, 0, 1);
@@ -267,9 +269,11 @@ public class ProcessInstanceKillsTest extends BaseTestClass {
         bundles[0].submitFeedsScheduleProcess(prism);
         InstanceUtil.waitTillInstancesAreCreated(cluster, bundles[0].getProcessData(), 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
-        prism.getProcessHelper().getProcessInstanceSuspend(processName, "?start=2010-01-02T01:00Z");
+        TimeUtil.sleepSeconds(30);
+        prism.getProcessHelper().getProcessInstanceSuspend(processName,
+                "?start=2010-01-02T01:00Z&end=2010-01-02T01:04Z");
         InstancesResult r = prism.getProcessHelper().getProcessInstanceKill(processName,
-                "?start=2010-01-02T01:00Z");
+                "?start=2010-01-02T01:00Z&end=2010-01-02T01:04Z");
         InstanceUtil.validateSuccess(r, bundles[0], WorkflowStatus.KILLED);
     }
 
@@ -289,7 +293,7 @@ public class ProcessInstanceKillsTest extends BaseTestClass {
         InstanceUtil.waitTillInstanceReachState(serverOC.get(0), processName, 1,
                 CoordinatorAction.Status.SUCCEEDED, EntityType.PROCESS);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceKill(processName,
-                "?start=2010-01-02T01:00Z");
+                "?start=2010-01-02T01:00Z&end=2010-01-02T01:04Z");
         InstanceUtil.validateSuccess(r, bundles[0], WorkflowStatus.SUCCEEDED);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/ad0979e7/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
index 62a8b2b..e704309 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
@@ -186,9 +186,11 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1,
             CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
-        prism.getProcessHelper().getProcessInstanceKill(processName, start);
+        prism.getProcessHelper().getProcessInstanceKill(processName,
+                start + "&end=2010-01-02T01:01Z");
         String wfID = InstanceUtil.getWorkflows(cluster, processName, Status.KILLED).get(0);
-        prism.getProcessHelper().getProcessInstanceRerun(processName, start);
+        prism.getProcessHelper().getProcessInstanceRerun(processName,
+                start + "&end=2010-01-02T01:01Z");
         Assert.assertTrue(InstanceUtil.isWorkflowRunning(clusterOC, wfID));
     }
 
@@ -211,7 +213,8 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
             Status.SUCCEEDED).get(0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 0, CoordinatorAction
             .Status.SUCCEEDED, EntityType.PROCESS);
-        prism.getProcessHelper().getProcessInstanceRerun(processName, start);
+        prism.getProcessHelper().getProcessInstanceRerun(processName,
+                start + "&end=2010-01-02T01:01Z");
         Assert.assertTrue(InstanceUtil.isWorkflowRunning(clusterOC, wfID));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/ad0979e7/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
index f564bb4..8ffeb09 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
@@ -110,7 +110,8 @@ public class ProcessInstanceResumeTest extends BaseTestClass {
         InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
             wholeRange);
         InstanceUtil.validateResponse(r, 6, 2, 4, 0, 0);
-        r = prism.getProcessHelper().getProcessInstanceResume(processName, "?end=2010-01-02T01:15Z");
+        r = prism.getProcessHelper().getProcessInstanceResume(processName,
+                "?start=2010-01-02T01:00Z&end=2010-01-02T01:15Z");
         InstanceUtil.validateResponse(r, 3, 3, 0, 0, 0);
     }
 
@@ -175,10 +176,10 @@ public class ProcessInstanceResumeTest extends BaseTestClass {
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0,
0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1,
             CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 2);
-        String start = "?start=2010-01-02T01:00Z";
-        prism.getProcessHelper().getProcessInstanceSuspend(processName, start);
-        prism.getProcessHelper().getProcessInstanceResume(processName, start);
-        InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
start);
+        String param = "?start=2010-01-02T01:00Z&end=2010-01-02T01:26Z";
+        prism.getProcessHelper().getProcessInstanceSuspend(processName, param);
+        prism.getProcessHelper().getProcessInstanceResume(processName, param);
+        InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
param);
         InstanceUtil.validateResponse(r, 6, 1, 0, 5, 0);
     }
 
@@ -206,7 +207,7 @@ public class ProcessInstanceResumeTest extends BaseTestClass {
     public void testProcessInstanceResumeNoParams() throws Exception {
         bundles[0].submitFeedsScheduleProcess(prism);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceResume(processName,
null);
-        InstanceUtil.validateSuccessWithStatusCode(r, 0);
+        InstanceUtil.validateSuccessWithStatusCode(r, 2);
     }
 
     /**
@@ -236,7 +237,7 @@ public class ProcessInstanceResumeTest extends BaseTestClass {
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 6,
             CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
-        String start = "?start=2010-01-02T01:05Z";
+        String start = "?start=2010-01-02T01:05Z&end=2010-01-02T01:26Z";
         InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
start);
         InstanceUtil.validateResponse(r, 5, 5, 0, 0, 0);
         r = prism.getProcessHelper().getProcessInstanceResume(processName, start);
@@ -257,7 +258,7 @@ public class ProcessInstanceResumeTest extends BaseTestClass {
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 6,
             CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
-        String last = "?start=2010-01-02T01:25Z";
+        String last = "?start=2010-01-02T01:25Z&end=2010-01-02T01:26Z";
         prism.getProcessHelper().getProcessInstanceSuspend(processName, last);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceStatus(processName,
             wholeRange);

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/ad0979e7/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceSuspendTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceSuspendTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceSuspendTest.java
index bcdd704..049f278 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceSuspendTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceSuspendTest.java
@@ -132,7 +132,7 @@ public class ProcessInstanceSuspendTest extends BaseTestClass {
         InstanceUtil.waitTillInstanceReachState(clusterOC, Util.getProcessName(bundles[0]
             .getProcessData()), 1, CoordinatorAction.Status.SUCCEEDED, EntityType.PROCESS);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceSuspend(processName,
-            "?start=2010-01-02T01:00Z");
+            "?start=2010-01-02T01:00Z&end=2010-01-02T01:01Z");
         InstanceUtil.validateSuccessWithStatusCode(r, 0);
     }
 
@@ -233,7 +233,7 @@ public class ProcessInstanceSuspendTest extends BaseTestClass {
             CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceSuspend(processName,
             "?start=2010-01-02T01:00Z");
-        InstanceUtil.validateResponse(r, 3, 0, 3, 0, 0);
+        InstanceUtil.validateSuccessWithStatusCode(r, 2);
     }
 
     /**
@@ -255,7 +255,8 @@ public class ProcessInstanceSuspendTest extends BaseTestClass {
         InstancesResult result = prism.getProcessHelper().getProcessInstanceStatus(processName,
             "?start=2010-01-02T01:00Z&end=2010-01-02T01:21Z");
         InstanceUtil.validateResponse(result, 5, 5, 0, 0, 0);
-        prism.getProcessHelper().getProcessInstanceSuspend(processName, "?start=2010-01-02T01:20Z");
+        prism.getProcessHelper().getProcessInstanceSuspend(processName,
+                "?start=2010-01-02T01:20Z&end=2010-01-02T01:23Z");
         result = prism.getProcessHelper().getProcessInstanceStatus(processName,
             "?start=2010-01-02T01:00Z&end=2010-01-02T01:21Z");
         InstanceUtil.validateResponse(result, 5, 4, 1, 0, 0);


Mime
View raw message