提交 8755e59c 编写于 作者: C Christoph Kutzinski

[FIXED JENKINS-11073] handle failure to set timestamp on Windows platforms...

[FIXED JENKINS-11073] handle failure to set timestamp on Windows platforms more gracefully - this time hopefully for real
上级 8656049f
......@@ -64,6 +64,9 @@ Upcoming changes</a>
<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 @@ Upcoming changes</a>
<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 @@ public final class FilePath implements Serializable {
/**
* 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 final class FilePath implements Serializable {
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 class FilePathTest extends ChannelTestCase {
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());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册