[ 
https://issues.apache.org/jira/browse/SUREFIRE-1502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434550#comment-16434550
 ] 

Tibor Digana edited comment on SUREFIRE-1502 at 4/11/18 8:42 PM:
-----------------------------------------------------------------

[~larry_west]
Larry, I created a docker project but it does not crash. It just runs 3 second. 
I tried several times.
Can you please use my sources and tell me what's different with your use case 
on your system?

{code:bash}
sudo docker build --no-cache -t mymvn:1 -f ./Dockerfile .
sudo docker run -it --rm mymvn:1 /bin/sh
{code}

Run the command {{mvn test}} in the shell console of docker.

{{Dockerfile}}
{code:bash}
FROM maven:3.5.3-jdk-8-alpine
COPY ./. /
{code}

{{src/test/java/MyTest.java}}
{code:java}
import org.junit.Test;

public class MyTest {
    @Test
    public void test() throws InterruptedException {
        Thread.sleep(3000L);
    }
} 
{code}

{{pom.xml}}
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>

    <groupId>x</groupId>
    <artifactId>x</artifactId>
    <version>1.0</version>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
            </plugin>
        </plugins>
    </build>


</project>
{code}



was (Author: tibor17):
[~larry_west]
Larry, I created a docker project but it does not crash. It just runs 3 second. 
I tried several times.
Can you please use my sources and tell me what's different with your use case 
on your system?

{code:shell}
sudo docker build --no-cache -t mymvn:1 -f ./Dockerfile .
sudo docker run -it --rm mymvn:1 /bin/sh
{code}

Run the command {{mvn test}} in the shell console of docker.

{{Dockerfile}}
{code:shell}
FROM maven:3.5.3-jdk-8-alpine
COPY ./. /
{code}

{{src/test/java/MyTest.java}}
{code:java}
import org.junit.Test;

public class MyTest {
    @Test
    public void test() throws InterruptedException {
        Thread.sleep(3000L);
    }
} 
{code}

{{pom.xml}}

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>

    <groupId>x</groupId>
    <artifactId>x</artifactId>
    <version>1.0</version>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
            </plugin>
        </plugins>
    </build>


</project>
{code}


> Forking fails on OS/X
> ---------------------
>
>                 Key: SUREFIRE-1502
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1502
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: process forking
>    Affects Versions: 2.20.1, 2.21.0
>         Environment: OS/X 10.13.3
> Java 1.8.0_162
>            Reporter: Larry West
>            Assignee: Tibor Digana
>            Priority: Major
>         Attachments: surefire3972773662020453876tmp, 
> surefire_06790995305937656848tmp
>
>
> This is very similar to SUREFIRE-1422, but is still present _intermittently_ 
> on version 2.21.0 as well as 2.20.1.  It was not present on 2.19.1.
> The symptom is that all tests run fine (the reports are there), but as soon 
> as they do, there is an error:
> {noformat}
> The forked VM terminated without properly saying goodbye. VM crash or 
> System.exit called?
>  ...
> Process Exit Code: 0
> {noformat}
> This of course fails the build.
> This occurs on roughly half the builds (with 2.21.0, at least).
> Maven version 3.5.3. Java 1.8.0_162. OS/X 10.13.3.
> h5. Selected output from mvn -X
> {noformat}
> [DEBUG] Forking command line: /bin/sh -c cd /Users/lwest/git/caas/jsk-cc && 
> /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java 
> -jar 
> /Users/lwest/git/caas/jsk-cc/target/surefire/surefirebooter4496843559994461722.jar
>  /Users/lwest/git/caas/jsk-cc/target/surefire 2018-03-16T16-08-09_300-jvmRun1 
> surefire3972773662020453876tmp surefire_06790995305937656848tmp
> {noformat}
> ... then, after all the tests have run, successfully, it reports failure:
> {noformat}
> Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: The 
> forked VM terminated without properly saying goodbye. VM crash or System.exit 
> called?
> Command was /bin/sh -c cd /Users/lwest/git/caas/jsk-cc && 
> /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java 
> -jar 
> /Users/lwest/git/caas/jsk-cc/target/surefire/surefirebooter4496843559994461722.jar
>  /Users/lwest/git/caas/jsk-cc/target/surefire 2018-03-16T16-08-09_300-jvmRun1 
> surefire3972773662020453876tmp surefire_06790995305937656848tmp
> Process Exit Code: 0
>     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork 
> (ForkStarter.java:671)
>     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork 
> (ForkStarter.java:533)
>     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run 
> (ForkStarter.java:278)
>     at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run 
> (ForkStarter.java:244)
>     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider 
> (AbstractSurefireMojo.java:1148)
>     at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked
>  (AbstractSurefireMojo.java:977)
>     at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute 
> (AbstractSurefireMojo.java:853)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:208)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:154)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:146)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:229)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:415)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:356)
> {noformat}
> There are no "[date]-jvmRun[N].dump", "[date].dumpstream" or 
> "[date]-jvmRun[N].dumpstream" files.
> h5. Addendum
> One detail that is perhaps not relevant is that our projects always use 
> {{file.encoding=UTF-8}}, but I see that ForkStarter has hard-coded 
> {{ISO_8859_1}} as the StreamCharset param to executeCommandLineAsCallable().



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to