Skip to content
Commit c49d6b5b authored by Jesse Glick's avatar Jesse Glick
Browse files

Use TemporaryFolder to good effect.

Prevents us from leaving behind a temp dir with cyclic symlinks, which breaks JGit’s clean function.
That in turn can cause test builds to break:
https://jenkins.ci.cloudbees.com/job/core/job/jenkins_main_trunk/783/console
Cleaning workspace
FATAL: Could not delete file …/workspace/core/jenkins_main_trunk/core/target/hudson5309354136960541268tmp/c/symlink/c/symlink/c/symlink/…/c/foo.xml
org.eclipse.jgit.api.errors.JGitInternalException: Could not delete file …/workspace/core/jenkins_main_trunk/core/target/hudson5309354136960541268tmp/c/symlink/c/symlink/c/symlink/…/c/foo.xml
	at org.eclipse.jgit.api.CleanCommand.call(CleanCommand.java:137)
	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.clean(JGitAPIImpl.java:305)
	at hudson.plugins.git.GitAPI.clean(GitAPI.java:248)
	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1213)
	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1196)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2236)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:326)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: Could not delete file …/workspace/core/jenkins_main_trunk/core/target/hudson5309354136960541268tmp/c/symlink/c/symlink/c/symlink/…/c/foo.xml
	at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:142)
	at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
	at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
	…
	at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
	at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
	at org.eclipse.jgit.api.CleanCommand.call(CleanCommand.java:132)
	... 14 more
parent 90f3ad5d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment