Status: Resolved (View Workflow)
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.
- is related to
JENKINS-25975 More reliable test infrastructure
- links to
I think would suffice to add methods to JenkinsRule.
Code changed in jenkins
User: Jesse Glick
JENKINS-26398 Linking to a filed issue.
Need to recheck with JenkinsSessionRule.
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
Maybe split slave creation into KillableSlaveRule for example and bind it where required to JenkinsRule?