Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jenskreidler opened this issue Apr 18, 2019 · 2 comments

Comments

@jenskreidler
Copy link

jenskreidler commented Apr 18, 2019

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 arquillian/arquillian-extension-persistence#123 ?

@jenskreidler
Copy link
Author

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
Copy link
Member

Thanks for reporting this issue and providing reproducer 💯 🥇

I will give it a spin this week.

abregar added a commit to abregar/arquillian-extension-transaction that referenced this issue Feb 19, 2023
- keeping junit4 as this extension is still not ready for junit5, see arquillian/arquillian-extension-persistence#195
- update versions arquillian core and junit4
psi-msudra added a commit to psi-msudra/arquillian-extension-persistence that referenced this issue Dec 13, 2023
Since version 1.0.4 of arquillian transaction extension, @after remains within
the transaction bounds, TransactionHandler first proceeds and then ends the
transaction. This causes that after persistence test logic is applied before
the test method transaction is finished. This fix restores the correct ordering
of after persistence test logic.

arquillian/arquillian-extension-transaction@92864c8

arquillian/arquillian-extension-transaction#21
psi-msudra added a commit to PSI-Polska/arquillian-extension-persistence that referenced this issue Dec 13, 2023
Since version 1.0.4 of arquillian transaction extension, @after remains within
the transaction bounds, TransactionHandler first proceeds and then ends the
transaction. This causes that after persistence test logic is applied before
the test method transaction is finished. This fix restores the correct ordering
of after persistence test logic.

arquillian/arquillian-extension-transaction@92864c8

arquillian/arquillian-extension-transaction#21
psi-msudra added a commit to PSI-Polska/arquillian-extension-persistence that referenced this issue Dec 18, 2023
Since version 1.0.4 of arquillian transaction extension, @after remains within
the transaction bounds, TransactionHandler first proceeds and then ends the
transaction. This causes that after persistence test logic is applied before
the test method transaction is finished. This fix restores the correct ordering
of after persistence test logic.

arquillian/arquillian-extension-transaction@92864c8

arquillian/arquillian-extension-transaction#21
TheOnlyAl pushed a commit to TheOnlyAl/arquillian-extension-persistence that referenced this issue Feb 14, 2024
Since version 1.0.4 of arquillian transaction extension, @after remains within
the transaction bounds, TransactionHandler first proceeds and then ends the
transaction. This causes that after persistence test logic is applied before
the test method transaction is finished. This fix restores the correct ordering
of after persistence test logic.

arquillian/arquillian-extension-transaction@92864c8

arquillian/arquillian-extension-transaction#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants