arquillian / arquillian-extension-transaction

9 stars 10 forks source link

Arquillian Persistence does not cleanup or commit between multiple test-methods - integration-tests state currupted #21

Open jenskreidler opened 5 years ago

jenskreidler commented 5 years ago
Issue Overview

Problem with integration test state using transactions, @UsingDataSet and @ShouldMatchDataSet: It seems that Arquillian Persistence does not clean up a previous test-method's setup or commit a subsequent test-method's state.

Expected Behaviour

Method 1 executes: it seeds state with @UsingDataSet, test code manipulates persistence context. Method 2 executes subsequently: it seeds cleanly an other state with @UsingDataSet, test code manipluates persistence context and @ShouldMatchDataSet ensures database state-

Current Behaviour

With arquillian-persistence:1.2.0.2, method 2 gets a corrupted persistence state from method 1 and test code - a database insert - is not commited and thus verifyable using method 2's @ShouldMatchDataSet.

Steps To Reproduce
  1. Use/fork my ape-transaction-test project: https://github.com/jenskreidler/ape-transaction-test.git
  2. Configure project for your local enviroment (see README)
  3. Run mvn clean install (uses arquillian-persistence:1.2.0.2) => UserService_IT fails
  4. In pom.xml, switch arquillian-persistence to version 1.1.13.0 => UserService_IT succeeds
Additional information

Maybe this issue is related to https://github.com/arquillian/arquillian-extension-persistence/issues/123 ?

jenskreidler commented 5 years ago

Anyone who's tried my simple "UserService_IT" from the project I've linked?

IMHO this is a blocker upgrading and using arquillian-persistence in your JEE projects

bartoszmajsak commented 5 years ago

Thanks for reporting this issue and providing reproducer :100: :1st_place_medal:

I will give it a spin this week.