Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8781

Docker tests fail if Minion SSH service refreshes while SSH is being checked



    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 19.0.0
    • 19.0.0
    • Testing / JUnit
    • Security Level: Default (Default Security Scheme)
    • None


      It looks like the routines that detect Minion startup are throwing an exception if they happen to connect to the Minion SSH service on port 8201 at just the same moment that the bundles are refreshing. SSH appears to blink on, off, then back on during one of the feature installations.

      If the SSH bundle refreshes after the test class connects to SSH but before it can run all of its commands, the following exception is thrown:

      03-Oct-2016 13:06:38	2016-10-03 13:06:38,032 INFO [Connect thread localhost session] com.jcraft.jsch - Caught an exception, leaving main loop due to Socket closed
      03-Oct-2016 13:06:43	2016-10-03 13:06:43,033 INFO [pool-40-thread-1] com.jcraft.jsch - Connecting to localhost port 35793
      03-Oct-2016 13:06:43	2016-10-03 13:06:43,034 INFO [pool-40-thread-1] com.jcraft.jsch - Connection established
      03-Oct-2016 13:06:43	2016-10-03 13:06:43,034 INFO [pool-40-thread-1] com.jcraft.jsch - Disconnecting from localhost port 35793
      03-Oct-2016 13:06:43	2016-10-03 13:06:43,034 ERROR [main] org.opennms.test.system.api.NewTestEnvironment - Test failed!
      03-Oct-2016 13:06:43	com.jcraft.jsch.JSchException: Session.connect: java.net.SocketException: Connection reset
      03-Oct-2016 13:06:43	        at com.jcraft.jsch.Session.connect(Session.java:558)
      03-Oct-2016 13:06:43	        at com.jcraft.jsch.Session.connect(Session.java:183)
      03-Oct-2016 13:06:43	        at org.opennms.test.system.api.utils.SshClient.openShell(SshClient.java:92)
      03-Oct-2016 13:06:43	        at org.opennms.test.system.api.NewTestEnvironment.canMinionConnectToOpenNMS(NewTestEnvironment.java:620)
      03-Oct-2016 13:06:43	        at org.opennms.test.system.api.NewTestEnvironment.lambda$waitForMinion$2(NewTestEnvironment.java:613)
      03-Oct-2016 13:06:43	        at com.jayway.awaitility.core.CallableCondition$ConditionEvaluationWrapper.eval(CallableCondition.java:100)
      03-Oct-2016 13:06:43	        at com.jayway.awaitility.core.ConditionAwaiter$ConditionPoller.run(ConditionAwaiter.java:179)
      03-Oct-2016 13:06:43	        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      03-Oct-2016 13:06:43	        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      03-Oct-2016 13:06:43	        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      03-Oct-2016 13:06:43	        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      03-Oct-2016 13:06:43	        at java.lang.Thread.run(Thread.java:745)

      We should catch this exception, consider it a failure to connect and retry.




            Unassigned Unassigned
            seth Seth Leger
            0 Vote for this issue
            3 Start watching this issue