falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject falcon git commit: FALCON-2081 ExtensionManagerIT fails occassionally
Date Wed, 20 Jul 2016 19:30:28 GMT
Repository: falcon
Updated Branches:
  refs/heads/master dc36866af -> 40d943637


FALCON-2081 ExtensionManagerIT fails occassionally

Fixed a rat-check error as part of this Jira as it was blocking testing and it was only 1
line change

Author: bvellanki <bvellanki@hortonworks.com>

Reviewers: "Venkat Ranganathan <venkat@hortonworks.com>, Sowmya Ramesh <sowmya_kr@apache.org>"

Closes #235 from bvellanki/FALCON-2081


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

Branch: refs/heads/master
Commit: 40d943637067b04747b337e714f1588567fa4751
Parents: dc36866
Author: bvellanki <bvellanki@hortonworks.com>
Authored: Wed Jul 20 12:30:19 2016 -0700
Committer: bvellanki <bvellanki@hortonworks.com>
Committed: Wed Jul 20 12:30:19 2016 -0700

----------------------------------------------------------------------
 pom.xml                                              |  1 +
 .../apache/falcon/resource/ExtensionManagerIT.java   |  4 ++++
 .../java/org/apache/falcon/resource/TestContext.java | 15 +++++++++++++++
 3 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/40d94363/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dc2ffaf..9d33625 100644
--- a/pom.xml
+++ b/pom.xml
@@ -217,6 +217,7 @@
                                 <exclude>**/db1.script</exclude>
                                 <exclude>**/credential_provider.jceks</exclude>
                                 <exclude>**/*.json</exclude>
+                                <exclude>**/falcon-cli-hist.log</exclude>
                             </excludes>
                         </configuration>
                         <executions>

http://git-wip-us.apache.org/repos/asf/falcon/blob/40d94363/webapp/src/test/java/org/apache/falcon/resource/ExtensionManagerIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/ExtensionManagerIT.java b/webapp/src/test/java/org/apache/falcon/resource/ExtensionManagerIT.java
index b352be4..021d853 100644
--- a/webapp/src/test/java/org/apache/falcon/resource/ExtensionManagerIT.java
+++ b/webapp/src/test/java/org/apache/falcon/resource/ExtensionManagerIT.java
@@ -18,6 +18,7 @@
 
 package org.apache.falcon.resource;
 
+import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.extensions.ExtensionProperties;
 import org.apache.falcon.extensions.mirroring.hdfs.HdfsMirroringExtensionProperties;
 import org.apache.falcon.extensions.store.AbstractTestExtensionStore;
@@ -110,12 +111,15 @@ public class ExtensionManagerIT extends AbstractTestExtensionStore {
                 "extension -instances -jobName " + JOB_NAME_2 + " -fields status,clusters,tags"),
0);
 
         // validate instance list results
+        context.waitForInstancesToStart(EntityType.PROCESS.name(), JOB_NAME_1, 10000);
         ExtensionInstanceList instanceList = context.getExtensionInstances(JOB_NAME_1, START_TIME_1,
endTime, "RUNNING",
                 null, null, null, null, null, null);
         System.out.println("Validate running instances of extension job " + JOB_NAME_1 +
": \n"
                 + instanceList.toString());
         Assert.assertEquals(instanceList.numEntities, 1);
         Assert.assertEquals(instanceList.entitySummary.get(0).instances.length, 1);
+
+        context.waitForInstancesToStart(EntityType.PROCESS.name(), JOB_NAME_2, 10000);
         instanceList = context.getExtensionInstances(JOB_NAME_2, START_TIME_1, endTime, "RUNNING",
                 null, null, null, null, null, null);
         System.out.println("Validate running instances of extension job " + JOB_NAME_2 +
": \n"

http://git-wip-us.apache.org/repos/asf/falcon/blob/40d94363/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/TestContext.java b/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
index 5173032..42a5247 100644
--- a/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
+++ b/webapp/src/test/java/org/apache/falcon/resource/TestContext.java
@@ -325,6 +325,21 @@ public class TestContext extends AbstractTestContext {
         return response.getEntity(ExtensionInstanceList.class);
     }
 
+    public void waitForInstancesToStart(String entityType, String entityName, long timeout)
{
+        long mustEnd = System.currentTimeMillis() + timeout;
+        WebResource resource = this.service.path("api/instance/running/" + entityType + "/"
+ entityName);
+        InstancesResult instancesResult;
+        while (System.currentTimeMillis() < mustEnd) {
+            ClientResponse response = resource.header("Cookie", AUTH_COOKIE_EQ + authenticationToken)
+                    .accept(MediaType.APPLICATION_JSON).type(MediaType.TEXT_XML)
+                    .method(HttpMethod.GET, ClientResponse.class);
+            instancesResult = response.getEntity(InstancesResult.class);
+            if (instancesResult.getInstances() != null && instancesResult.getInstances().length
> 0) {
+                break;
+            }
+        }
+    }
+
     public ClientResponse submitAndSchedule(String template, Map<String, String> overlay,
EntityType entityType)
         throws Exception {
         return submitAndSchedule(template, overlay, entityType, null, "", null);


Mime
View raw message