• Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: High High
    • Dublin Release
    • None
    • None
    • DMAAP-Dub-01-(12/3/18-12/13)

      Failing on IDE after build of whole project, but are passing when started one by one

      Currently the state is that these tests are failing in local build:

      [ERROR] Failures:
      [ERROR] DR_SubResourceTest.DelTest:223
      [ERROR] DR_SubResourceTest.PutTest:201
      [ERROR] MR_ClusterResourceTest.DelTest:158
      [ERROR] TopicResourceTest.DelTest:184

       

      Analysis:

      All resource testing is based on Jersey framework for server endpoint testing and the real problem is that Jersey is not refreshing, not touching any static content initialized during Application configuration, so during the whole application build with tests such static content will be initialized once and every test running will be dependent on the current state of such content.

      There is a class called DatabaseClass.java which has static maps and static singleton DMaaP holder logic. This class and its implementation is the root cause of randomly failing Resources tests. Every test will be dependent on the current "Database" content and there is no cleanup anywhere of these maps with references , for example mr_clusters or dmaap holder instance. Currently depending on the tests invocation order the result might be different and unexpected. Also a developer who creates new such Jersey Framework-based tests has no idea that "DB" could have initial values which came from another tests.

            kamyk kamyk
            kamyk kamyk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: