[jboss-jira] [JBoss JIRA] (WFCORE-1048) IOException from EmbeddedServerFactorySetupUnitTestCase on Windows

Petr Kremensky (JIRA) issues at jboss.org
Tue Oct 13 01:53:00 EDT 2015


    [ https://issues.jboss.org/browse/WFCORE-1048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117594#comment-13117594 ] 

Petr Kremensky commented on WFCORE-1048:
----------------------------------------

I have two Virtual Windows servers available. One is w2k8 the other is w2k12.

I found there is a difference in  the granularity of measured time for these (currentTimeMillis() [javadoc|http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis%28%29]):
{code:java}
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
for (int i = 0; i < 100; i++) {
    System.out.println(format.format(new Date()));
}
{code}

w2k8 - EmbeddedServerFactorySetupUnitTestCase pass locally
{noformat}
...
20151013073755993
20151013073755994
20151013073755994
20151013073755994
20151013073755995
20151013073755995
20151013073755995
20151013073755995
20151013073755995
20151013073755995
20151013073755995
...
{noformat}
w2k12 - EmbeddedServerFactorySetupUnitTestCase fails locally
{noformat}
...
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259519
20151013074259535
20151013074259535
20151013074259535
20151013074259535
...
{noformat}
Adding more output to the test I can see that it really tries to create directory with the same timestamp more than once. We have to either change the way of how the name of temp root directory is generated, or add some waiting between the tests.

Following solves the issue for me locally:
{noformat}
public class EmbeddedServerFactorySetupUnitTestCase {
...
     @Before
-    public void createEmbeddedRoot() {
+    public void createEmbeddedRoot() throws InterruptedException {
+        Thread.sleep(1L);
         embeddedRoot = new File("target/embedded-root").getAbsoluteFile();
{noformat}


> IOException from EmbeddedServerFactorySetupUnitTestCase on Windows
> ------------------------------------------------------------------
>
>                 Key: WFCORE-1048
>                 URL: https://issues.jboss.org/browse/WFCORE-1048
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: CLI, Test Suite
>    Affects Versions: 2.0.0.CR6
>         Environment: Windows
>            Reporter: Petr Kremensky
>            Assignee: Tomaz Cerar
>         Attachments: TEST-org.wildfly.core.embedded.EmbeddedServerFactorySetupUnitTestCase.xml
>
>
> org.wildfly.core.embedded.EmbeddedServerFactorySetupUnitTestCase fails on Windows with
> {noformat}
> java.lang.IllegalStateException: WFLYEMB0020: Cannot setup embedded server
> 	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:81)
> 	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> 	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> 	at sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:504)
> 	at java.nio.file.Files.createDirectory(Files.java:674)
> 	at org.wildfly.core.embedded.EmbeddedStandaloneServerFactory.getTempRoot(EmbeddedStandaloneServerFactory.java:178)
> 	at org.wildfly.core.embedded.EmbeddedStandaloneServerFactory.setupCleanDirectories(EmbeddedStandaloneServerFactory.java:107)
> 	at org.wildfly.core.embedded.EmbeddedServerFactorySetupUnitTestCase.testServerOverrideAndDataAndConfigOverride(EmbeddedServerFactorySetupUnitTestCase.java:112)
> {noformat}
> Reproducer job running against the latest core bits https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-7x-core-embedded-windows-reproducer/
> I am able to reproduce locally on my VM host, however test doesn't seem to throw the exception on regular basis (see #4, where build on w2k12 passed (same slave for w2k12 as for #3))



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list