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

Fix createSlave for RestartableJenkinsRule

    XMLWordPrintable

Details

    • 1746.v2b_3c5d1983b_e

    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

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

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

            I think would suffice to add methods to JenkinsRule.

            jglick Jesse Glick added a comment - I think would suffice to add methods to JenkinsRule .

            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

            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
            jglick Jesse Glick added a comment -

            Need to recheck with JenkinsSessionRule.

            jglick Jesse Glick added a comment - Need to recheck with JenkinsSessionRule .
            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
            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

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

              Dates

                Created:
                Updated:
                Resolved: