I’m remotely running a JUnit test suite with Ant from my local machine to a remote server with a ~30 minute timeout. Running these JUnit tests with javac/java works fine since JUnit outputs a . or E after each test. This continuous output keeps the ssh connection alive for the ~9 hours that the test suite needs to run. However with Ant, there isn’t any output until the test suite is completed, which kills the testing process way too early. I’ve tried several different result reporting methods (writing to a file, nearly all formatting options, etc).
My question is either:
How can I keep the SSH connection alive long enough for my test suite to finish? I don’t have access/permission to alter any ssh connection settings and since the code is on the remote server I can’t send anything to the server from my local machine before/during/after each test.
or
How can I set up Ant to print/echo some sort of output during each test? Using echo with Java’s ProcessBuilder doesn’t show up in Terminal.
I don’t know if there a parameters to avoid a timeout ( which is probably server side ), but you should consider using the NOHUP command ( see NOHUP ). This will allow you to launch your command and close your ssh session without stopping the command.
Alexis