mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
JENKINS-15418 take shares int account, ignore short paths
This commit is contained in:
1 parent
edbe2aedca
commit
f66e19c072
2 files changed
+44
-2
No files matched your search
@@ -474,5 +474,32 @@ public class FilePathTest extends ChannelTestCase {
|
||||
Util.deleteRecursive(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Bug(15418)
|
||||
public void testDeleteLongPathOnWindows() throws Exception {
|
||||
File tmp = Util.createTempDir();
|
||||
try {
|
||||
FilePath d = new FilePath(french, tmp.getPath());
|
||||
|
||||
// construct a very long path
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while(sb.length() + tmp.getPath().length() < 260 - "very/".length()) {
|
||||
sb.append("very/");
|
||||
}
|
||||
sb.append("pivot/very/very/long/path");
|
||||
|
||||
FilePath longPath = d.child(sb.toString());
|
||||
longPath.mkdirs();
|
||||
FilePath childInLongPath = longPath.child("file.txt");
|
||||
childInLongPath.touch(0);
|
||||
|
||||
File firstDirectory = new File(tmp.getAbsolutePath() + "/very");
|
||||
Util.deleteRecursive(firstDirectory);
|
||||
|
||||
assertFalse("Could not delete directory!", firstDirectory.exists());
|
||||
|
||||
} finally {
|
||||
Util.deleteRecursive(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user