Permalink
Browse files

[FIXED JENKINS-11073] handle failure to set timestamp on Windows plat…

…forms more gracefully - this time hopefully for real
  • Loading branch information...
kutzi committed Nov 23, 2011
1 parent 8656049 commit 8755e59c9a48375cbe6b602e7553bd0508acfe87
Showing with 24 additions and 5 deletions.
  1. +3 −3 changelog.html
  2. +2 −2 core/src/main/java/hudson/FilePath.java
  3. +19 −0 core/src/test/java/hudson/FilePathTest.java
@@ -64,6 +64,9 @@
<li class=bug>
Fixed ConcurrentModificationException in parallel Maven 3 builds.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11256">issue 11256</a>)
<li class=bug>
Copy artifacts fails on windows slaves due to failing to set a timestamp.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11073">issue 11073</a>)
<li class=rfe>
CLI jar now has the version number in the manifest as well as the "-version" option.
<li class=rfe>
@@ -95,9 +98,6 @@ <h3><a name=v1.440>What's new in 1.440</a> (2011/11/17)</h3>
<li class=bug>
Dependency wasn't recalculated with CLI "update-job" command.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11636">issue 11636</a>)
<li class=bug>
Copy artifacts fails on windows slaves due to failing to set a timestamp.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11073">issue 11073</a>)
<li class=rfe>
Sortable table wasn't "stable" when there are same values in different rows
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11551">issue 11551</a>)
@@ -291,7 +291,7 @@ private static String normalize(String path) {
/**
* Checks if the remote path is Unix.
*/
private boolean isUnix() {
boolean isUnix() {
// if the path represents a local path, there' no need to guess.
if(!isRemote())
return File.pathSeparatorChar!=';';
@@ -1429,7 +1429,7 @@ public void copyToWithPermission(FilePath target) throws IOException, Interrupte
target.touch(lastModified());
} catch (IOException e) {
// On Windows this seems to fail often. See JENKINS-11073
if (!isUnix()) {
if (!target.isUnix()) {
LOGGER.warning("Failed to set timestamp on " + target.getRemote());
} else { // rethrow
throw new IOException2(e);
@@ -23,6 +23,7 @@
*/
package hudson;

import hudson.remoting.LocalChannel;
import hudson.remoting.VirtualChannel;
import hudson.util.IOException2;
import hudson.util.NullStream;
@@ -296,5 +297,23 @@ public void testListWithExcludes() throws Exception {
Util.deleteRecursive(baseDir);
}
}

@Bug(11073)
public void testIsUnix() {
FilePath winPath = new FilePath(new LocalChannel(null),
" c:\\app\\hudson\\workspace\\3.8-jelly-db\\jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver\\acceptance-tests\\distribution.zip");
assertFalse(winPath.isUnix());

FilePath base = new FilePath(new LocalChannel(null),
"c:\\app\\hudson\\workspace\\3.8-jelly-db");
FilePath middle = new FilePath(base, "jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver");
FilePath full = new FilePath(middle, "acceptance-tests\\distribution.zip");
assertFalse(full.isUnix());


FilePath unixPath = new FilePath(new LocalChannel(null),
"/home/test");
assertTrue(unixPath.isUnix());
}

}

0 comments on commit 8755e59

Please sign in to comment.