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-2010 Fix UT errors due to ActiveMQ upgrade
Date Mon, 06 Jun 2016 18:58:45 GMT
Repository: falcon
Updated Branches:
  refs/heads/master f8707fdc6 -> fb4d0b495


FALCON-2010 Fix UT errors due to ActiveMQ upgrade

Fixed two test failures due to the upgrade:

1. JMSMessageConsumerTest
After upgrade, some messages are consumed faster and so the initial expectation on no message
being dequeued right after the message sending doesn't hold. Also confirmed with bvellanki
that this kind of tests are flaky and have caused intermittent test errors before. Therefore,
removed getTotalDequeueCount assertion. In addition, the expected message consumptions are
tested in existing code "Mockito.verify(jobEndService,...".

2. FalconPostProcessingTest
After upgrade, Falcon will run into an error if it tries to delete messages when ActiveMQ
service is stopped. Therefore, need to call start before deleting the message during teardown.

Author: yzheng-hortonworks <yzheng@hortonworks.com>

Reviewers: "Balu Vellanki <balu@apache.org>, Venkat Ranganathan <venkat@hortonworks.com>,
Pallavi Rao <pallavi@apache.org>"

Closes #169 from yzheng-hortonworks/FALCON-2010


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

Branch: refs/heads/master
Commit: fb4d0b4955429e6cef413ab073814fc800361bd4
Parents: f8707fd
Author: yzheng-hortonworks <yzheng@hortonworks.com>
Authored: Mon Jun 6 11:58:56 2016 -0700
Committer: bvellanki <bvellanki@hortonworks.com>
Committed: Mon Jun 6 11:58:56 2016 -0700

----------------------------------------------------------------------
 .../falcon/messaging/JMSMessageConsumerTest.java     | 15 ---------------
 .../oozie/workflow/FalconPostProcessingTest.java     |  3 +++
 2 files changed, 3 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/fb4d0b49/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java
----------------------------------------------------------------------
diff --git a/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java
b/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java
index 0ba9464..6237bdf 100644
--- a/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java
+++ b/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java
@@ -245,15 +245,10 @@ public class JMSMessageConsumerTest {
             sendMessages(TOPIC_NAME, WorkflowExecutionContext.Type.POST_PROCESSING);
 
             final BrokerView adminView = broker.getAdminView();
-
-            Assert.assertEquals(adminView.getTotalDequeueCount(), 0);
-//            Assert.assertEquals(adminView.getTotalEnqueueCount(), 10);
             Assert.assertEquals(adminView.getTotalConsumerCount(), 2);
 
             sendMessages(SECONDARY_TOPIC_NAME, WorkflowExecutionContext.Type.POST_PROCESSING);
 
-//            Assert.assertEquals(adminView.getTotalEnqueueCount(), 18);
-            Assert.assertEquals(adminView.getTotalDequeueCount(), 0);
             Assert.assertEquals(adminView.getTotalConsumerCount(), 3);
         } catch (Exception e) {
             Assert.fail("This should not have thrown an exception.", e);
@@ -265,9 +260,6 @@ public class JMSMessageConsumerTest {
         sendMessages(TOPIC_NAME, WorkflowExecutionContext.Type.WORKFLOW_JOB);
 
         final BrokerView adminView = broker.getAdminView();
-
-        Assert.assertEquals(adminView.getTotalDequeueCount(), 0);
-//        Assert.assertEquals(adminView.getTotalEnqueueCount(), 10);
         Assert.assertEquals(adminView.getTotalConsumerCount(), 2);
 
         // Async operations. Give some time for messages to be processed.
@@ -283,9 +275,6 @@ public class JMSMessageConsumerTest {
         sendMessages(TOPIC_NAME, WorkflowExecutionContext.Type.COORDINATOR_ACTION);
 
         final BrokerView adminView = broker.getAdminView();
-
-        Assert.assertEquals(adminView.getTotalDequeueCount(), 0);
-//        Assert.assertEquals(adminView.getTotalEnqueueCount(), 12);
         Assert.assertEquals(adminView.getTotalConsumerCount(), 2);
 
         // Async operations. Give some time for messages to be processed.
@@ -309,11 +298,7 @@ public class JMSMessageConsumerTest {
         sendMessages(TOPIC_NAME, WorkflowExecutionContext.Type.WORKFLOW_JOB, false /* isFalconWF
*/);
 
         final BrokerView adminView = broker.getAdminView();
-
-        Assert.assertEquals(adminView.getTotalDequeueCount(), 0);
-        Assert.assertEquals(adminView.getTotalEnqueueCount(), 10);
         Assert.assertEquals(adminView.getTotalConsumerCount(), 2);
-        Assert.assertEquals(adminView.getTotalMessageCount(), 0);
 
         Thread.sleep(100);
         Mockito.verify(jobEndService, Mockito.never()).notifyStart(Mockito.any(WorkflowExecutionContext.class));

http://git-wip-us.apache.org/repos/asf/falcon/blob/fb4d0b49/oozie/src/test/java/org/apache/falcon/oozie/workflow/FalconPostProcessingTest.java
----------------------------------------------------------------------
diff --git a/oozie/src/test/java/org/apache/falcon/oozie/workflow/FalconPostProcessingTest.java
b/oozie/src/test/java/org/apache/falcon/oozie/workflow/FalconPostProcessingTest.java
index 1c50a97..4132c3a 100644
--- a/oozie/src/test/java/org/apache/falcon/oozie/workflow/FalconPostProcessingTest.java
+++ b/oozie/src/test/java/org/apache/falcon/oozie/workflow/FalconPostProcessingTest.java
@@ -100,6 +100,9 @@ public class FalconPostProcessingTest {
 
     @AfterClass
     public void tearDown() throws Exception {
+        if (broker.isStopped()) {
+            broker.start(true);
+        }
         broker.deleteAllMessages();
         broker.stop();
     }


Mime
View raw message