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
[LIVY-647][TEST]Fix travis failed on batch session should not be gc-ed until application is finished #222
Conversation
Codecov Report
@@ Coverage Diff @@
## master #222 +/- ##
============================================
+ Coverage 68.34% 68.75% +0.41%
- Complexity 919 923 +4
============================================
Files 100 100
Lines 5715 5742 +27
Branches 867 884 +17
============================================
+ Hits 3906 3948 +42
+ Misses 1242 1234 -8
+ Partials 567 560 -7
Continue to review full report at Codecov.
|
cabea88
to
b019117
Compare
…l application is finished
Run the test again. |
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.
LGTM. Merging to master branch.
What changes were proposed in this pull request?
Fix travis failed on "batch session should not be gc-ed until application is finished"
The cause of failed is as follows:
When create BatchSessionManager, the GarbageCollector thread will be created, which collect garbage according to session.state. However the session was mocked, and the test thread execute doReturn(s).when(session).state several times, if the test thread do half of the statement doReturn(s).when(session).state, and GarbageCollector thread check session.state at this time, the exception will threw by GarbageCollector thread.
So the fix avoid executing doReturn(s).when(session).state after session has been registered into SessionManager.
How was this patch tested?
Existed UT and IT.