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

Fix createSlave for RestartableJenkinsRule

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If you use JenkinsRule.createSlave (or createOnlineSlave) from a test based on RestartableJenkinsRule, it seems to work during the first session. But then the whole slave directory gets quietly deleted during the restart.

      Either this deletion should be suppressed, or there should be an alternate method to create a slave that actually survives the restart intact.

      See WorkflowTest.buildShellScriptAcrossRestart and BindingStepTest.cleanupAfterRestart.

        Attachments

          Issue Links

            Activity

            Hide
            integer Kanstantsin Shautsou added a comment -

            Maybe split slave creation into KillableSlaveRule for example and bind it where required to JenkinsRule?

            Show
            integer Kanstantsin Shautsou added a comment - Maybe split slave creation into KillableSlaveRule for example and bind it where required to JenkinsRule?
            Hide
            jglick Jesse Glick added a comment -

            I think would suffice to add methods to JenkinsRule.

            Show
            jglick Jesse Glick added a comment - I think would suffice to add methods to JenkinsRule .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/ec779e6d6937e5d7777e11a03d415f76a11bff74
            Log:
            JENKINS-26398 Linking to a filed issue.
            Originally-Committed-As: 73d09e62b8b094f2865d1aab32044cf402965108

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/ec779e6d6937e5d7777e11a03d415f76a11bff74 Log: JENKINS-26398 Linking to a filed issue. Originally-Committed-As: 73d09e62b8b094f2865d1aab32044cf402965108
            Hide
            jglick Jesse Glick added a comment -

            Need to recheck with JenkinsSessionRule.

            Show
            jglick Jesse Glick added a comment - Need to recheck with JenkinsSessionRule .
            Hide
            jglick Jesse Glick added a comment -

            Still a problem with JenkinsSessionRule. The issue is that JenkinsSessionRule.tmp survives restarts but JenkinsRule.env.temporaryDirectoryAllocator as used by createTmpDir does not, and createSlave still uses createTmpDir. Options include

            • use some other agent root dir (e.g. inside $JENKINS_HOME)
            • use a TemporaryFolder scoped to JenkinsSessionRule
            • allow JenkinsRule.env to be overridden from JenkinsSessionRule
            Show
            jglick Jesse Glick added a comment - Still a problem with JenkinsSessionRule . The issue is that JenkinsSessionRule.tmp survives restarts but JenkinsRule.env.temporaryDirectoryAllocator as used by createTmpDir does not, and createSlave still uses createTmpDir . Options include use some other agent root dir (e.g. inside $JENKINS_HOME ) use a TemporaryFolder scoped to JenkinsSessionRule allow JenkinsRule.env to be overridden from JenkinsSessionRule

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jglick Jesse Glick
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: