JenkinsRule#restart preserves the original root path
#936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My initial implementation of
JenkinsRule#restartin #716 seems to be flawed in a sense that the underlying Jenkins instance is restored with a copy of the originalJENKINS_HOMEunder a new path.In jenkinsci/throttle-concurrent-builds-plugin#302 in became clear that this impacts some corner cases where this path is actually relevant for some plugins (see jenkinsci/throttle-concurrent-builds-plugin#302 (comment)).
This PR aims to remove this flaw. Now
JenkinsRule#restartwill start a new instance with a copy of the originalJENKINS_HOMEunder the same path as the previous instance. This is achieved by creating abackup.zipfrom the currentJENKINS_HOMEbefore shutting it down and starting a new instance from the unzipped backup that has the same path as before.I do not assume that this change will cause any incompatibilities as I can not find evidence of a tests validating / building upon the flaws of the initial implementation.
Ping @basil @jglick Your input would be very welcome.
Testing done
Adapted the existing tests.
Submitter checklist