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:
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.