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

MonitoredServiceDaoIT test fail due to database

    XMLWordPrintable

    Details

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

      Description

      Tests run: 5, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 17.145 sec <<< FAILURE! - in org.opennms.netmgt.dao.MonitoredServiceDaoIT
      testLazy(org.opennms.netmgt.dao.MonitoredServiceDaoIT)  Time elapsed: 0.047 sec  <<< ERROR!
      org.springframework.dao.DataIntegrityViolationException: could not insert: [org.opennms.netmgt.model.OnmsNode]; SQL [insert into node (nodeCreateTime, foreignId, foreignSource, hasFlows, nodeLabel, nodeLabelSource, lastCapsdPoll, location, nodeDomainName, nodeNetBIOSName, operatingSystem, nodeParentID, nodeSysContact, nodeSysDescription, nodeSysLocation, nodeSysName, nodeSysOID, nodeType, nodeId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [node_foreign_unique_idx]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [org.opennms.netmgt.model.OnmsNode]
      ...
      

      The issue isn't due to testLazy, but testFindAllServices. Adding the @Transactional annotation to testFindAllServices fixes the underlying problem.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ronald.roskens@biworldwide.com Ron Roskens
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: