runzhiwang opened a new pull request #222: [LIVY-647]Fix travis failed on batch 
session should not be gc-ed until application is finished
URL: https://github.com/apache/incubator-livy/pull/222
 
 
   ## 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:
   
   1. 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.
   
   2. So the fix avoid collecting garbage of mocked session.
   
   3. Modify the test can also fix this bug, but it cannot avoid the similar 
bug happening in the future.
   
   ## How was this patch tested?
   
   Existed UT and IT.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to