jsch session instance
Hi, I am using jsch session in multiple test cases. I setup the server at start of the testcase and close the session at the end using groovy script.
Server setup code :
import com.jcraft.jsch.Session;
def servName = context.expand( '${#Project#servName}' )
ServerConfig servCon = new ServerConfig(servName)
def session = servCon.serverConnect(servName)
context.testCase.metaClass.session = session
log.info("Connected")
Session closing code:
import com.jcraft.jsch.Session;
def session = context.testCase.session
session.disconnect()
This works fine when testcases are run sequentially. However, throws error when they are run in parallel.
ERROR:An error occurred [session is down], see error log for details
ERROR:An error occurred [connection is closed by foreign host], see error log for details
I am guessing either it is not recognizing the individual sessions or closing all sessions when any of the testcase finishes. Rest of them throws the error. I would want to mention that whenever Ready!API is launched and run the testcases do run in parallel without any issues. But in the second run they throw this error. Is there a issue with how I am passing the instance?