提交 4c50c7a9 编写于 作者: B Baptiste Mathus

Log exception in case of failure

I see we enter that catch, and the `else` in a failing test.
But I'm somewhat stuck since I miss both the stack, and even at
least the exception being thrown and not being an
`AtomicMoveNotSupportedException`.

It's possibly an `IOException` or some subclass. But still having the
stack could help understand why the test fails, and provide more
data for diagnosis in the future in production use.

```
=== Starting hudson.cli.RunRangeCommandTest
   0.007 [id=96]	WARNING	o.jvnet.hudson.test.JenkinsRule#before: Jenkins.theInstance was not cleared by a previous test, doing that now
   0.018 [id=96]	INFO	o.jvnet.hudson.test.JenkinsRule#createWebServer: Running on http://localhost:45833/jenkins/
   0.037 [id=15]	WARNING	jenkins.model.Jenkins#cleanUp: This instance is no longer the singleton, ignoring cleanUp()
   0.345 [id=96]	WARNING	hudson.util.AtomicFileWriter#commit: Unable to move atomically, falling back to non-atomic move.
   0.345 [id=96]	SEVERE	hudson.util.AtomicFileWriter#commit: Unable to move /home/jenkins/workspace/Core_jenkins_PR-2548-5VRJ4BBBSEGVOZEA7OVAL2YLTLCBL55RB4LDQIZN56WJZD4M6ZKA/test/target/jenkinsTests.tmp/jenkins333129509690162870test/atomic9184049448662376708tmp to /home/jenkins/workspace/Core_jenkins_PR-2548-5VRJ4BBBSEGVOZEA7OVAL2YLTLCBL55RB4LDQIZN56WJZD4M6ZKA/test/target/jenkinsTests.tmp/jenkins333129509690162870test/secret.key. Attempting to delete /home/jenkins/workspace/Core_jenkins_PR-2548-5VRJ4BBBSEGVOZEA7OVAL2YLTLCBL55RB4LDQIZN56WJZD4M6ZKA/test/target/jenkinsTests.tmp/jenkins333129509690162870test/atomic9184049448662376708tmp and abandoning.
```
上级 9b482009
......@@ -152,9 +152,9 @@ public class AtomicFileWriter extends Writer {
// If it falls here that can mean many things. Either that the atomic move is not supported,
// or something wrong happened. Anyway, let's try to be over-diagnosing
if (e instanceof AtomicMoveNotSupportedException) {
LOGGER.log(Level.WARNING, "Atomic move not supported. falling back to non-atomic move.");
LOGGER.log(Level.WARNING, "Atomic move not supported. falling back to non-atomic move.", e);
} else {
LOGGER.log(Level.WARNING, "Unable to move atomically, falling back to non-atomic move.");
LOGGER.log(Level.WARNING, "Unable to move atomically, falling back to non-atomic move.", e);
}
if (destPath.toFile().exists()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册