-
Notifications
You must be signed in to change notification settings - Fork 61
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
Spock Unroll tests rollback regression #911
Comments
timyates
added a commit
that referenced
this issue
Feb 16, 2024
When a feature is using `@Unroll` (which is implicit in recent versions of Spock), we needed to add the interceptor to the iteration interceptor handler instead of the standard handler. This bug was visible in #911 where specs that were parameterized did not properly revert the transaction between iterations. Closes #911
sdelamo
pushed a commit
that referenced
this issue
Feb 16, 2024
When a feature is using `@Unroll` (which is implicit in recent versions of Spock), we needed to add the interceptor to the iteration interceptor handler instead of the standard handler. This bug was visible in #911 where specs that were parameterized did not properly revert the transaction between iterations. Closes #911
timyates
added a commit
that referenced
this issue
Feb 16, 2024
When a feature is using `@Unroll` (which is implicit in recent versions of Spock), we needed to add the interceptor to the iteration interceptor handler instead of the standard handler. This bug was visible in #911 where specs that were parameterized did not properly revert the transaction between iterations. Closes #911
@mattlong-finocomp Thank you so much for the report and the reproducer! This is fixed by #953 and will be in the forthcoming micronaut-test 4.2.1 and 4.3.0 👍 |
sdelamo
pushed a commit
that referenced
this issue
Feb 16, 2024
When a feature is using `@Unroll` (which is implicit in recent versions of Spock), we needed to add the interceptor to the iteration interceptor handler instead of the standard handler. This bug was visible in #911 where specs that were parameterized did not properly revert the transaction between iterations. Closes #911
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
When writing a Spock test that has Unroll semantics (which is now implicit) performs DB operations, the transaction should be rolled back for each iteration that is performed.
This used to be the case in Micronaut 3.
Actual Behaviour
The transaction is not rolled back until after all iterations of the Unroll are performed.
The transaction is rolled back for each iteration if the MicronautTest annotation has a transactionMode of SINGLE_TRANSACTION.
Steps To Reproduce
Run the following tests in the linked example application:
UnrollRollbackSpec - proves that the transaction isn't rolled back between iterations
UnrollRollbackSingleTransactionSpec - proves that the transaction is rolled back between iterations when transactionMode is SINGLE_TRANSACTION
Environment Information
OS: Pop!OS 22.04
Java: 17
Example Application
https://github.com/mattlong-finocomp/micronaut-unroll-rollback
Version
4.2.1
The text was updated successfully, but these errors were encountered: