Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8214

AlarmdIT.testPersistManyAlarmsAtOnce() test ordering issue?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 18.0.0
    • Fix Version/s: 18.0.0
    • Component/s: Testing / JUnit
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      This test had an intermittent failure in one of my branches. It looks like an alarm has been left in the database between executions or possibly an ActiveMQ message has been replayed from disk just before the test executed.

      Bamboo log:

      error	08-Mar-2016 17:33:39	TemporaryDatabaseExecutionListener.beforeTestMethod([DefaultTestContext@3439f68d testClass = AlarmdIT, testInstance = org.opennms.netmgt.alarmd.AlarmdIT@47c06b1a, testMethod = testPersistManyAlarmsAtOnce@AlarmdIT, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@71d15f18 testClass = AlarmdIT, locations = '{classpath:/META-INF/opennms/applicationContext-soa.xml, classpath:/META-INF/opennms/applicationContext-commonConfigs.xml, classpath:/META-INF/opennms/applicationContext-minimal-conf.xml, classpath:/META-INF/opennms/applicationContext-dao.xml, classpath*:/META-INF/opennms/component-dao.xml, classpath:/META-INF/opennms/applicationContext-daemon.xml, classpath:/META-INF/opennms/mockEventIpcManager.xml, classpath:/META-INF/opennms/applicationContext-alarmd.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]])
      build	08-Mar-2016 17:33:39	2016-03-08 17:33:39,504 DEBUG [main] org.opennms.core.test.OpenNMSAbstractTestExecutionListener - starting test method public void org.opennms.netmgt.alarmd.AlarmdIT.testPersistManyAlarmsAtOnce() throws java.lang.InterruptedException
      error	08-Mar-2016 17:33:39	injecting TemporaryDatabase into TemporaryDatabaseAware test: AlarmdIT.testPersistManyAlarmsAtOnce
      build	08-Mar-2016 17:33:39	2016-03-08 17:33:39,514 DEBUG [main] org.opennms.core.soa.support.DefaultServiceRegistry - Registered org.opennms.netmgt.alarmd.AlarmdIT$MockNorthbounder@2a073f4f as instance of [interface org.opennms.netmgt.alarmd.api.Northbounder]
      build	08-Mar-2016 17:33:39	2016-03-08 17:33:39,516 DEBUG [main] org.opennms.core.test.OpenNMSAbstractTestExecutionListener - finishing test method public void org.opennms.netmgt.alarmd.AlarmdIT.testPersistManyAlarmsAtOnce() throws java.lang.InterruptedException
      error	08-Mar-2016 17:33:39	TemporaryDatabaseExecutionListener.afterTestMethod([DefaultTestContext@3439f68d testClass = AlarmdIT, testInstance = org.opennms.netmgt.alarmd.AlarmdIT@47c06b1a, testMethod = testPersistManyAlarmsAtOnce@AlarmdIT, testException = java.lang.AssertionError: expected:<0> but was:<1>, mergedContextConfiguration = [MergedContextConfiguration@71d15f18 testClass = AlarmdIT, locations = '{classpath:/META-INF/opennms/applicationContext-soa.xml, classpath:/META-INF/opennms/applicationContext-commonConfigs.xml, classpath:/META-INF/opennms/applicationContext-minimal-conf.xml, classpath:/META-INF/opennms/applicationContext-dao.xml, classpath*:/META-INF/opennms/component-dao.xml, classpath:/META-INF/opennms/applicationContext-daemon.xml, classpath:/META-INF/opennms/mockEventIpcManager.xml, classpath:/META-INF/opennms/applicationContext-alarmd.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]])
      
      build	08-Mar-2016 17:33:50	Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 22.155 sec <<< FAILURE! - in org.opennms.netmgt.alarmd.AlarmdIT
      build	08-Mar-2016 17:33:50	testPersistManyAlarmsAtOnce(org.opennms.netmgt.alarmd.AlarmdIT)  Time elapsed: 1.694 sec  <<< FAILURE!
      build	08-Mar-2016 17:33:50	java.lang.AssertionError: expected:<0> but was:<1>
      build	08-Mar-2016 17:33:50		at org.opennms.netmgt.alarmd.AlarmdIT.testPersistManyAlarmsAtOnce(AlarmdIT.java:227)
      

        Attachments

          Activity

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              seth Seth Leger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: