-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Clear outer instances when init test state is called #26644
Conversation
The init test state is called several times depending whether JUnit 5 is configured with the lifecycle method based or class based. Clearing out the outer instances every time the main class is initialized, ensure that the outer instances are always up to date.
These changes are related to this comment: #26556 (comment) @famod @ivansenic, I added a test to ensure that the number of outer instances is always correct (before it was wrong as you spotted). However, I could not reproduce the issue you were seeing, so can you double-check whether these changes do fix your issues? |
Failing Jobs - Building 28fc5cf
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 18 #- Failing: extensions/smallrye-reactive-messaging-kafka/deployment
! Skipped: integration-tests/kafka-oauth-keycloak integration-tests/kafka-sasl-elytron integration-tests/reactive-messaging-hibernate-reactive and 2 more 📦 extensions/smallrye-reactive-messaging-kafka/deployment✖
|
I could.. Just tell me what's the easiest way to build everything as snapshot? Or what's the best way to test this? |
Simply, build |
I'm sure this will fix the imminent issue because I already tested it with that very line added, but I'll re-test later today. I'd like to point out though that this will still lead to accumulating outer instances during execution of methods of a default method lifecycle nested class. |
Will do, hopefully today.. |
@Sgitario Took me some time, but here it is: ✔️ existing tests are now working fine Thanks a lot 👍 |
Thanks for confirming it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected. Sorry for the delay!
Let's merge this now and improve later the instance accumulation issue that I mentioned earlier.
The init test state is called several times depending whether JUnit 5 is configured with the lifecycle method based or class based.
Clearing out the outer instances every time the main class is initialized, ensure that the outer instances are always up to date.