Hi Martin, this is actually intended behavior of the Unit Testing module in Mendix. When the “Rollback microflow tests after execution” option is enabled, all changes made in the test microflow, including the TearDown are rolled back at the end of the test. This ensures the database stays unchanged after each test.
So, even though your TearDown deletes objects, the rollback undoes those deletes, making it seem like they never happened.
Solution:
You already did the correct thing, disable “Rollback microflow tests after execution” this allows TearDown to truly persist and clean up data.
Recommendation:
Use Rollback = ON during normal test runs (to keep the DB clean) and disable it only when testing persistent side effects or cleanup logic like in your case.
Thanks for this topic!