falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rostafiyc...@apache.org
Subject git commit: FALCON-776 Fixing PrismFeedUpdateTest and FeedInstanceStatus test issues. Contributed by Raghav Kumar Gautam
Date Fri, 03 Oct 2014 05:48:49 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master 4e614ff1f -> a00b2ef9f


FALCON-776 Fixing PrismFeedUpdateTest and FeedInstanceStatus test issues. 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/a00b2ef9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/a00b2ef9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/a00b2ef9

Branch: refs/heads/master
Commit: a00b2ef9fcadcf5ecaa4b9ff6855dca5cf49222b
Parents: 4e614ff
Author: Ruslan Ostafiychuk <rostafiychuk@apache.org>
Authored: Fri Oct 3 08:47:35 2014 +0300
Committer: Ruslan Ostafiychuk <rostafiychuk@apache.org>
Committed: Fri Oct 3 08:47:35 2014 +0300

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                                | 3 +++
 .../regression/core/interfaces/IEntityManagerHelper.java     | 4 ++++
 .../org/apache/falcon/regression/core/util/OozieUtil.java    | 5 ++---
 .../org/apache/falcon/regression/EmbeddedPigScriptTest.java  | 2 ++
 .../org/apache/falcon/regression/FeedInstanceStatusTest.java | 4 ++--
 .../org/apache/falcon/regression/prism/EntityDryRunTest.java | 6 ++++--
 .../apache/falcon/regression/prism/PrismFeedUpdateTest.java  | 8 ++++----
 7 files changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 4746950..502e7f5 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -87,6 +87,9 @@ Trunk (Unreleased)
    FALCON-681 delete duplicate feed retention test from falcon regression (SamarthG)
 
   BUG FIXES
+   FALCON-776 Fixing PrismFeedUpdateTest and FeedInstanceStatus test issues (Raghav Kumar
Gautam
+   via Ruslan Ostafiychuk)
+
    FALCON-747 validateSuccessOnlyStart should use '1' as expected value (Ruslan Ostafiychuk)
 
    FALCON-737 In NoOutputProcessTest print info before assertion (Raghav Kumar Gautam via
Ruslan Ostafiychuk)

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/interfaces/IEntityManagerHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/interfaces/IEntityManagerHelper.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/interfaces/IEntityManagerHelper.java
index ec8726c..66a1b7f 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/interfaces/IEntityManagerHelper.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/interfaces/IEntityManagerHelper.java
@@ -409,6 +409,8 @@ public abstract class IEntityManagerHelper {
 
     public ServiceResponse update(String oldEntity, String newEntity, String user)
         throws IOException, URISyntaxException, AuthenticationException {
+        LOGGER.info("Updating " + getEntityType() + ": \n" + Util.prettyPrintXml(oldEntity));
+        LOGGER.info("To " + getEntityType() + ": \n" + Util.prettyPrintXml(newEntity));
         String url = createUrl(this.hostname + URLS.UPDATE.getValue(), getEntityType(),
             getEntityName(oldEntity));
         return Util.sendRequest(url + colo, "post", newEntity, user);
@@ -417,6 +419,8 @@ public abstract class IEntityManagerHelper {
     public ServiceResponse update(String oldEntity, String newEntity, String updateTime,
                                   String user)
         throws IOException, URISyntaxException, AuthenticationException {
+        LOGGER.info("Updating " + getEntityType() + ": \n" + Util.prettyPrintXml(oldEntity));
+        LOGGER.info("To " + getEntityType() + ": \n" + Util.prettyPrintXml(newEntity));
         String url = this.hostname + URLS.UPDATE.getValue() + "/" + getEntityType() + "/"
             + Util.readEntityName(oldEntity);
         String urlPart = colo == null || colo.isEmpty() ? "?" : colo + "&";

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/OozieUtil.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/OozieUtil.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/OozieUtil.java
index 806bbd3..c42531e 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/OozieUtil.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/OozieUtil.java
@@ -422,10 +422,9 @@ public final class OozieUtil {
         return DateTimeFormat.forPattern("yyyy'-'MM'-'dd'T'HH':'mm'Z'");
     }
 
-    public static int getNumberOfBundle(ColoHelper helper, EntityType type, String entityName)
+    public static int getNumberOfBundle(OozieClient oozieClient, EntityType type, String
entityName)
         throws OozieClientException {
-        return OozieUtil.getBundles(helper.getFeedHelper().getOozieClient(),
-            entityName, type).size();
+        return OozieUtil.getBundles(oozieClient, entityName, type).size();
     }
 
     public static void createMissingDependencies(ColoHelper helper, EntityType type,

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/EmbeddedPigScriptTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/EmbeddedPigScriptTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/EmbeddedPigScriptTest.java
index 99ffe37..f6c068d 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/EmbeddedPigScriptTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/EmbeddedPigScriptTest.java
@@ -148,6 +148,7 @@ public class EmbeddedPigScriptTest extends BaseTestClass {
     @Test(groups = {"singleCluster"})
     public void getRunningProcessInstance() throws Exception {
         AssertUtil.checkStatus(clusterOC, EntityType.PROCESS, process, Job.Status.RUNNING);
+        TimeUtil.sleepSeconds(TIMEOUT);
         InstancesResult r = prism.getProcessHelper().getRunningInstance(processName);
         InstanceUtil.validateSuccess(r, bundles[0], WorkflowStatus.RUNNING);
     }
@@ -155,6 +156,7 @@ public class EmbeddedPigScriptTest extends BaseTestClass {
     @Test(groups = {"singleCluster"})
     public void getKilledProcessInstance() throws Exception {
         prism.getProcessHelper().delete(process);
+        TimeUtil.sleepSeconds(TIMEOUT);
         InstancesResult r = prism.getProcessHelper().getRunningInstance(processName);
         Assert.assertEquals(r.getStatusCode(), ResponseKeys.PROCESS_NOT_FOUND,
             "Unexpected status code");

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceStatusTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceStatusTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceStatusTest.java
index 3b3ba71..031b32d 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceStatusTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceStatusTest.java
@@ -160,12 +160,12 @@ public class FeedInstanceStatusTest extends BaseTestClass {
         prism.getFeedHelper().getProcessInstanceStatus(feedName,
             "?start=" + TimeUtil.addMinsToTime(startTime, 40));
 
-        String postFix = "/US/" + cluster2.getClusterHelper().getColo();
+        String postFix = "/US/" + cluster2.getClusterHelper().getColoName();
         String prefix = bundles[0].getFeedDataPathPrefix();
         HadoopUtil.deleteDirIfExists(prefix.substring(1), cluster2FS);
         HadoopUtil.lateDataReplenish(cluster2FS, 80, 20, prefix, postFix);
 
-        postFix = "/UK/" + cluster3.getClusterHelper().getColo();
+        postFix = "/UK/" + cluster3.getClusterHelper().getColoName();
         prefix = bundles[0].getFeedDataPathPrefix();
         HadoopUtil.deleteDirIfExists(prefix.substring(1), cluster3FS);
         HadoopUtil.lateDataReplenish(cluster3FS, 80, 20, prefix, postFix);

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
index 55d69a3..991732b 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
@@ -32,6 +32,7 @@ import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.log4j.Logger;
+import org.apache.oozie.client.OozieClient;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
@@ -50,6 +51,7 @@ public class EntityDryRunTest extends BaseTestClass {
 
     private ColoHelper cluster = servers.get(0);
     private FileSystem clusterFS = serverFS.get(0);
+    private OozieClient clusterOC = serverOC.get(0);
     private String baseTestHDFSDir = baseHDFSDir + "/EntityDryRunTest";
     private String feedInputPath = baseTestHDFSDir + "/input" + MINUTE_DATE_PATTERN;
     private String feedOutputPath = baseTestHDFSDir + "/output-data" + MINUTE_DATE_PATTERN;
@@ -106,7 +108,7 @@ public class EntityDryRunTest extends BaseTestClass {
             bundles[0].getProcessData(), TimeUtil.getTimeWrtSystemTime(5), null);
         validate(response);
         Assert.assertEquals(
-            OozieUtil.getNumberOfBundle(cluster, EntityType.PROCESS, bundles[0].getProcessName()),
+            OozieUtil.getNumberOfBundle(clusterOC, EntityType.PROCESS, bundles[0].getProcessName()),
             1, "more than one bundle found after failed update request");
     }
 
@@ -135,7 +137,7 @@ public class EntityDryRunTest extends BaseTestClass {
         response = prism.getFeedHelper().update(feed, feed);
         validate(response);
         Assert.assertEquals(
-            OozieUtil.getNumberOfBundle(cluster, EntityType.FEED, Util.readEntityName(feed)),
1,
+            OozieUtil.getNumberOfBundle(clusterOC, EntityType.FEED, Util.readEntityName(feed)),
1,
             "more than one bundle found after failed update request");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/a00b2ef9/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
index a07161d..9b5d770 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/PrismFeedUpdateTest.java
@@ -235,9 +235,9 @@ public class PrismFeedUpdateTest extends BaseTestClass {
         feed.addProperty("someProp", "someVal");
         AssertUtil.assertSucceeded(prism.getFeedHelper().update(feed.toString(), feed.toString()));
         //check for new feed bundle creation
-        Assert.assertEquals(OozieUtil.getNumberOfBundle(prism, EntityType.FEED,
+        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1OC, EntityType.FEED,
             feed.getName()), 2);
-        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1, EntityType.PROCESS,
+        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1OC, EntityType.PROCESS,
             bundles[0].getProcessName()), 1);
     }
 
@@ -263,9 +263,9 @@ public class PrismFeedUpdateTest extends BaseTestClass {
         feed.setAvailabilityFlag("mytestflag");
         AssertUtil.assertSucceeded(prism.getFeedHelper().update(feed.toString(), feed.toString()));
         //check for new feed bundle creation
-        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1, EntityType.FEED,
+        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1OC, EntityType.FEED,
             feed.getName()), 2);
-        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1, EntityType.PROCESS,
+        Assert.assertEquals(OozieUtil.getNumberOfBundle(cluster1OC, EntityType.PROCESS,
             bundles[0].getProcessName()), 2);
     }
 


Mime
View raw message