This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 1320ad9  NO-JIRA more fixes into NotificationTest
1320ad9 is described below

commit 1320ad9367f1f1ce85d95dd0afaadc64afc2520f
Author: Clebert Suconic <[email protected]>
AuthorDate: Fri Apr 3 10:24:21 2020 -0400

    NO-JIRA more fixes into NotificationTest
    
    this test was failing intermittently.
    Some small speedup on the test as well.
---
 .../artemis/tests/integration/management/NotificationTest.java | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
index 38ffb4a..225f18a 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java
@@ -290,7 +290,7 @@ public class NotificationTest extends ActiveMQTestBase {
       
Assert.assertNotNull(notifications[1].getObjectProperty(ManagementHelper.HDR_CONNECTION_NAME));
       
Assert.assertNotNull(notifications[1].getObjectProperty(ManagementHelper.HDR_SESSION_NAME));
       Assert.assertEquals(SimpleString.toSimpleString("myUser"), 
notifications[1].getObjectProperty(ManagementHelper.HDR_USER));
-      Assert.assertTrue(notifications[1].getTimestamp() > start);
+      Assert.assertTrue(notifications[1].getTimestamp() >= start);
       Assert.assertTrue((long) 
notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) 
>= start);
       Assert.assertEquals(notifications[1].getTimestamp(), (long) 
notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP));
 
@@ -314,7 +314,7 @@ public class NotificationTest extends ActiveMQTestBase {
       Assert.assertEquals(CONNECTION_DESTROYED.toString(), 
notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
       
Assert.assertNotNull(notifications[1].getObjectProperty(ManagementHelper.HDR_CONNECTION_NAME));
       Assert.assertEquals(connectionId, 
notifications[1].getObjectProperty(ManagementHelper.HDR_CONNECTION_NAME).toString());
-      Assert.assertTrue(notifications[1].getTimestamp() > start);
+      Assert.assertTrue(notifications[1].getTimestamp() >= start);
       Assert.assertTrue((long) 
notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) 
>= start);
       Assert.assertEquals(notifications[1].getTimestamp(), (long) 
notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP));
    }
@@ -383,8 +383,7 @@ public class NotificationTest extends ActiveMQTestBase {
 
       long start = System.currentTimeMillis();
       producer.send(msg);
-      Thread.sleep(500);
-      consumer.receive(500);
+      Assert.assertNull(consumer.receiveImmediate());
 
       ClientMessage[] notifications = NotificationTest.consumeMessages(1, 
notifConsumer);
       Assert.assertEquals(MESSAGE_EXPIRED.toString(), 
notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
@@ -422,7 +421,6 @@ public class NotificationTest extends ActiveMQTestBase {
 
       long start = System.currentTimeMillis();
       producer.send(msg);
-      Thread.sleep(500);
 
       ClientMessage[] notifications = NotificationTest.consumeMessages(1, 
notifConsumer, 5000);
       Assert.assertEquals(MESSAGE_EXPIRED.toString(), 
notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
@@ -433,8 +431,6 @@ public class NotificationTest extends ActiveMQTestBase {
       Assert.assertTrue(notifications[0].getTimestamp() >= start);
       Assert.assertTrue((long) 
notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) 
>= start);
       Assert.assertEquals(notifications[0].getTimestamp(), (long) 
notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP));
-
-      session.deleteQueue(queue);
    }
 
    // Package protected ---------------------------------------------

Reply via email to