Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40261

Sauce connect process not stopping as part of Jenkins pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi
      We have Jenkins setup with no slaves and configured a job with using Jenkins pipeline but after protractor test case execution ends, sauce connect process is not stopping and it just simply hangs at that step
      We have to manually stop the job to close the process -

      eport created successfully!
      Aborted by anonymous
      Sending interrupt signal to process
      sh: line 1: 16950 Terminated JENKINS_SERVER_COOKIE=$jsc '/var/lib/jenkins/jobs/OAO_SauceLabs/workspace@tmp/durable-d1230cf0/script.sh' > '/var/lib/jenkins/jobs/OAO_SauceLabs/workspace@tmp/durable-d1230cf0/jenkins-log.txt' 2>&1
      Aborted by anonymous
      Aborted by anonymous
      Aborted by anonymous
      Aborted by anonymous
      Aborted by anonymous
      Click here to forcibly terminate running steps
      Click here to forcibly terminate running steps
      Click here to forcibly terminate running steps
      Click here to forcibly terminate running steps
      Click here to forcibly terminate running steps
      Click here to forcibly terminate running steps
      [Pipeline] }
      Decremented process count for NSB_team, now 0
      Flushing Sauce Connect Input Stream
      Flushing Sauce Connect Error Stream
      Closing Sauce Connect process
      Sauce Connect stopped for: NSB_team
      [Pipeline] // sauceconnect
      [Pipeline] }
      [Pipeline] // sauce
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline

      Below is version information -
      Jenkins 1.651.3
      Sauce OnDemand plugin 1.158
      Pipeline: Groovy 2.4

        Attachments

          Activity

          Hide
          halkeye Gavin Mogan added a comment -

          hi Ashutosh Mittal

          Can you give me a sample script that reproduces this?

          Reading your error log it seems like your sh/script step doesn't exit, but i'm not sure

          Show
          halkeye Gavin Mogan added a comment - hi Ashutosh Mittal Can you give me a sample script that reproduces this? Reading your error log it seems like your sh/script step doesn't exit, but i'm not sure
          Hide
          mittal_ashu11 Ashutosh Mittal added a comment - - edited

          Hi Gavin Mogan
          Below is the sample script i am using
          node {
          stage "Prep Server"
          git url: '<GIT Server URL>', branch: 'ashutosh-dev'

          stage "Test"
          echo 'Starting Sauce Connect...'
          sauce('452bedf5-7158-441c-bdb3-ac36d65a8704') {
          sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: true)

          { echo 'Starting testing with Protractor...' sh "/usr/bin/protractor cucumberSauceConf.js --cucumberOpts.tags='@oaoSmoke'" }

          }
          }

          Show
          mittal_ashu11 Ashutosh Mittal added a comment - - edited Hi Gavin Mogan Below is the sample script i am using node { stage "Prep Server" git url: '<GIT Server URL>', branch: 'ashutosh-dev' stage "Test" echo 'Starting Sauce Connect...' sauce('452bedf5-7158-441c-bdb3-ac36d65a8704') { sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: true) { echo 'Starting testing with Protractor...' sh "/usr/bin/protractor cucumberSauceConf.js --cucumberOpts.tags='@oaoSmoke'" } } }
          Hide
          halkeye Gavin Mogan added a comment -

          I'll try to look into it more, do you know if your server restarted or anything in the middle of the test? I havn't really tested that. I'll try to come up with a test case.
          Can you confirm your protractor tests are completing by adding another echo statement afterwards?

          node {
            stage "Prep Server"
            git url: '<GIT Server URL>', branch: 'ashutosh-dev'
            stage "Test"
            echo 'Starting Sauce Connect...'
            sauce('452bedf5-7158-441c-bdb3-ac36d65a8704') { 
              sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: true) {
                echo 'Starting testing with Protractor...'
                sh "/usr/bin/protractor cucumberSauceConf.js --cucumberOpts.tags='@oaoSmoke'" 
                echo 'Finished testing with Protractor...'
              }
            }
          }
          
          Show
          halkeye Gavin Mogan added a comment - I'll try to look into it more, do you know if your server restarted or anything in the middle of the test? I havn't really tested that. I'll try to come up with a test case. Can you confirm your protractor tests are completing by adding another echo statement afterwards? node { stage "Prep Server" git url: '<GIT Server URL>' , branch: 'ashutosh-dev' stage "Test" echo 'Starting Sauce Connect...' sauce( '452bedf5-7158-441c-bdb3-ac36d65a8704' ) { sauceconnect(options: '', useGeneratedTunnelIdentifier: false , verboseLogging: true ) { echo 'Starting testing with Protractor...' sh "/usr/bin/protractor cucumberSauceConf.js --cucumberOpts.tags= '@oaoSmoke' " echo 'Finished testing with Protractor...' } } }
          Hide
          mittal_ashu11 Ashutosh Mittal added a comment -

          I will test that part. I have tried it multiple times and it is the same thing every time.

          Show
          mittal_ashu11 Ashutosh Mittal added a comment - I will test that part. I have tried it multiple times and it is the same thing every time.
          Hide
          mittal_ashu11 Ashutosh Mittal added a comment -

          I think this issue is not with Sauce Connect process. It is with Protractor process not exiting properly.
          I ran scenario again which failed for different reasons and i can see everything exists properly. Below is the log -

          3 scenarios (3 failed)
          82 steps (3 failed, 67 skipped, 12 passed)
          0m43.166s
          Report created successfully!
          [12:49:21] I/sauce - SauceLabs results available at http://saucelabs.com/jobs/d8ae19d775a14d4282c1a9b21bf162a4
          [12:49:22] I/launcher - 0 instance(s) of WebDriver still running
          [12:49:22] I/launcher - Chrome - English failed 3 test(s)
          [12:49:22] I/launcher - overall: 3 failed spec(s)
          [12:49:22] E/launcher - Process exited with error code 1

          When i am seeing the issue with Protractor not exiting is when i see below error from sauce for my scenario execution -

          UnsupportedOperationError: ERROR The test with session id bf581e0a69274cb9acb4920c8cddea47 has already finished, and can't receive further commands.
          You can learn more at https://saucelabs.com/jobs/bf581e0a69274cb9acb4920c8cddea47
          For help, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages
          at WebDriverError (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:10)
          at UnsupportedOperationError (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:448:10)
          at parseHttpResponse (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:552:11)
          at /var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11
          at ManagedPromise.invokeCallback_ (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
          at TaskQueue.execute_ (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
          at TaskQueue.executeNext_ (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
          at /var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
          at /var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
          at process._tickCallback (node.js:369:9)

          Below is my flow -
          1. Scenario 1 failed due to some error
          2. Scenario 2 failed with above error
          3. Scenario 3 step just timed out

          Any idea how can i get support for above Sauce Labs error.

          Show
          mittal_ashu11 Ashutosh Mittal added a comment - I think this issue is not with Sauce Connect process. It is with Protractor process not exiting properly. I ran scenario again which failed for different reasons and i can see everything exists properly. Below is the log - 3 scenarios (3 failed) 82 steps (3 failed, 67 skipped, 12 passed) 0m43.166s Report created successfully! [12:49:21] I/sauce - SauceLabs results available at http://saucelabs.com/jobs/d8ae19d775a14d4282c1a9b21bf162a4 [12:49:22] I/launcher - 0 instance(s) of WebDriver still running [12:49:22] I/launcher - Chrome - English failed 3 test(s) [12:49:22] I/launcher - overall: 3 failed spec(s) [12:49:22] E/launcher - Process exited with error code 1 When i am seeing the issue with Protractor not exiting is when i see below error from sauce for my scenario execution - UnsupportedOperationError: ERROR The test with session id bf581e0a69274cb9acb4920c8cddea47 has already finished, and can't receive further commands. You can learn more at https://saucelabs.com/jobs/bf581e0a69274cb9acb4920c8cddea47 For help, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages at WebDriverError (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:10) at UnsupportedOperationError (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:448:10) at parseHttpResponse (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:552:11) at /var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11 at ManagedPromise.invokeCallback_ (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14) at TaskQueue.execute_ (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14) at TaskQueue.executeNext_ (/var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21) at /var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25 at /var/lib/jenkins/node-v4.4.7-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7 at process._tickCallback (node.js:369:9) Below is my flow - 1. Scenario 1 failed due to some error 2. Scenario 2 failed with above error 3. Scenario 3 step just timed out Any idea how can i get support for above Sauce Labs error.
          Hide
          halkeye Gavin Mogan added a comment -

          Hi Ashutosh Mittal

          Your best bet will be to contact sauce labs support, Please email support@saucelabs.com with a link to this ticket.

          I'm also going to close it as it doesn't seem like a plugin bug

          Show
          halkeye Gavin Mogan added a comment - Hi Ashutosh Mittal Your best bet will be to contact sauce labs support, Please email support@saucelabs.com with a link to this ticket. I'm also going to close it as it doesn't seem like a plugin bug

            People

            Assignee:
            halkeye Gavin Mogan
            Reporter:
            mittal_ashu11 Ashutosh Mittal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: