Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-53447

Some DM tests fail to clean the database properly

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 7.0.0 M4
    • Fix Version/s: 7.0.0 M4
    • Component/s: Documents & Media
    • Labels:
      None
    • Story Points:
      3

      Description

      DM tests fail in the CI environment because of a data dependency: a previous test failed to delete the database properly.

      After thorough examination, the problem was in DLAppLocalServiceTest, where there was the following code:

      // ... some test code here
      
      @DeleteAfterTestRun
      private Group _group;
      
      @DeleteAfterTestRun
      private Repository _repository
      

      The thing is that the rule was executing the cleanup logic in reverse order (first for Repository and then for Group), but there is a dependency from the later into the former: the group cleanup method is only able to remove data from repositories defined in the database. As the repository entries in the DB were being deleted before the group ones, stale data was left in the database.

      As a shortterm solution, it is enough to remove the @DeleteAfterTestRun annotation and let the Group remove everything. A more proper solution would be for the rule to execution cleanup code in the proper order.

        Attachments

          Activity

            People

            Assignee:
            yvonne.han Yvonne Han
            Reporter:
            adolfo.perez Adolfo Pérez
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              6 years, 38 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 M4