Unit testing a plugin on Windows: InjectedTest: File is being used

51 views
Skip to first unread message

Ivo Bellin Salarin

unread,
Feb 3, 2015, 5:55:58 AM2/3/15
to jenkin...@googlegroups.com
I'm experiencing this problem on windows:

org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest)  Time elapsed: 0.041 sec  <<< ERROR!
java.io.IOException: Failed to clean up temp dirs
        at org.jvnet.hudson.test.TemporaryDirectoryAllocator.dispose(TemporaryDirectoryAllocator.java:86)
        at org.jvnet.hudson.test.TestEnvironment.dispose(TestEnvironment.java:81)
        at org.jvnet.hudson.test.HudsonTestCase.tearDown(HudsonTestCase.java:414)
        at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.tearDown(JellyTestSuiteBuilder.java:138)
[..]
Caused by: java.nio.file.FileSystemException: C:\Users\BELLIN~1\AppData\Local\Temp\hudson5255949504888562847test\secret.key: Le processus ne peut pas accÚder au fichier car ce fichier est utilisÚ par un autre processus.

        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)

A similar problem is described on the page
But no workaround is provided.

The same kind of problem seems to appear often on windows environments (I can find several references to similar problems while googling)

I'm using Jenkins 1.554.1, but I experience the same problem with 1.559 and further versions.

Java is 1.8.0_25.

I'm unwilling to exclude the test from my POM. I'm also unwilling to exclude completely the unit tests on this OS.

Is there anybody who knows how to fix or workaround this issue?

Jesse Glick

unread,
Feb 3, 2015, 9:47:13 AM2/3/15
to Jenkins Dev
On Tue, Feb 3, 2015 at 5:55 AM, Ivo Bellin Salarin
<ivo.bell...@gmail.com> wrote:
> I'm using Jenkins 1.554.1, but I experience the same problem with 1.559 and
> further versions.

Check also on current dev versions. If the problem still occurs, you
need to dig up some tools to determine which process is holding on to
the file, and figure out why.

Daniel Beck

unread,
Feb 3, 2015, 12:53:39 PM2/3/15
to jenkin...@googlegroups.com
JENKINS-21977 was fixed in 1.579.
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF-_A8%2Bpp5qk_o6iHnza6qB3%3DGig0ztC4tXjkmRi%2BZ9vcw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Ivo Bellin Salarin

unread,
Feb 4, 2015, 2:31:55 AM2/4/15
to jenkin...@googlegroups.com
Just a philosophical/follow-up question about the issue 21977 (https://issues.jenkins-ci.org/browse/JENKINS-21977).

How am I expected to know in which build/jenkins version has it been integrated?


> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/DDFD8829-DF2E-40B5-9FB4-FC9D15639309%40beckweb.net.

Ivo Bellin Salarin

unread,
Feb 4, 2015, 2:35:18 AM2/4/15
to jenkin...@googlegroups.com
A supposition about my philosophical question:
In the issue comments, I can find a revision id. when I follow this link, I can find the related commit on github (https://github.com/jenkinsci/jenkins/commit/f39c435f8c86403653dc777516a4853e912044e3). This commit has been tagged 1.579.
OK?



Vincent Latombe

unread,
Feb 4, 2015, 3:56:44 AM2/4/15
to Jenkins Dev
That's right.


Vincent

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF_iJGtuwhW3fpMnHaKnPTXVgJc%3DBu7NdAhYaadoMF%3Dqrg%40mail.gmail.com.

oliver gondža

unread,
Feb 4, 2015, 11:01:38 AM2/4/15
to Ivo Bellin Salarin, jenkin...@googlegroups.com
FWIW, I have just come across the same thing. This seems to happen quite
often on Windows with different files as well. JenkinsRule does not fail
the test if TestEnvironment.dispose throws, but HudsonTestCase does. This
is addressed in [1].

[1]
https://github.com/jenkinsci/jenkins/commit/fac3c21367d16b6296850145e6116df762173310

--
oliver
Reply all
Reply to author
Forward
0 new messages