-
Notifications
You must be signed in to change notification settings - Fork 2.6k
DROOLS-1393 - Investigate why JpaOptLockPersistentStatefulSessionTest… #2019
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
Conversation
94b2410 to
550f481
Compare
|
@MarianMacik PR updated with your additional test |
550f481 to
5cdef64
Compare
|
Jenkins retest this |
|
Jenkins execute full downstream build |
5cdef64 to
d14fa31
Compare
|
@baldimir @MarianMacik made additional updates as the previous one were not enough, please have a look |
baldimir
left a comment
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.
Sorry for later review, few new comments.
| public void afterCompletion(int status) { | ||
| if ( status != TransactionManager.STATUS_COMMITTED ) { | ||
| this.service.rollback(); | ||
|
|
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.
Nitpicking - unnecessary empty line.
|
|
||
| public void resetApplicationScopedPersistenceContext() { | ||
| if ( this.internalAppScopedEntityManagerFlag ) { | ||
| if ( this.appScopedEntityManager != null && this.appScopedEntityManager.isOpen() ) { |
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.
Nitpicking #2: One space more here :)
| new InsertAndFireThread(ksession.getIdentifier(), kbase, list).start(); | ||
| Thread thread = new InsertAndFireThread(ksession.getIdentifier(), kbase, list); | ||
| threads.add(thread); | ||
| thread.start(); |
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.
On a second thought, I think we need to use an Executor with proper shutdown here, so we know that the threads ended.
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.
We know this, simply because we are waiting for them on the line 114.
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.
OK after discussion it can stay as it is.
| executor.execute(() -> { | ||
| try { | ||
| ksession1.insert(1); | ||
| ksession1.dispose(); |
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.
Please dispose the session also in a try-finally, so we are really sure it got disposed. It could be a large try-finally that covers most of this test and at the end of the test disposes everything disposable.
| ksession2.insert(2); | ||
| ksession1latch.countDown(); | ||
| } | ||
| ksession2.dispose(); |
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.
Same as previous comment about dispose. I found out that when something bad happens to a test (could be caused by environment) and the session doesn't get disposed, if there is a Timer in the session, then it stays running till the whole test suite ends. That is why I am very cautious about proper session dispose.
d14fa31 to
35c7ede
Compare
|
@baldimir changes applied |
|
Jenkins execute full downstream build |
|
SLA tests are unstable on KIE Jenkins so I think their fails are unrelated, but I am worried about migration tests (migration report was null in these tests), though it can be unrelated as well. |
|
@MarianMacik migration related tests should be already fixed by |
|
jenkins retest this |
|
Jenkins retest this |
… is failing with Hibernate 5
35c7ede to
7a99f15
Compare
|
Jenkins execute full downstream build |
|
Looks good now (only unstable tests failed). We are good to merge. |
… is failing with Hibernate 5