Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit vintage failing with "The forked VM terminated without properly saying goodbye" #801

Closed
vmassol opened this issue Apr 21, 2017 · 101 comments

Comments

@vmassol
Copy link

vmassol commented Apr 21, 2017

While building https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-oldcore with vintage 4.12.0-M4 I get the error:

"The forked VM terminated without properly saying goodbye. VM crash or System.exit called?"

This module builds fine with "standard" Maven surefire:

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>

But it fails when using:

<junit5.version>5.0.0-M4</junit5.version>
...
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
          <dependencies>
            <!-- Allow running both JUnit4 and JUnit5 tests -->
            <dependency>
              <groupId>org.junit.platform</groupId>
              <artifactId>junit-platform-surefire-provider</artifactId>
              <version>1.0.0-M4</version>
            </dependency>
            <dependency>
              <groupId>org.junit.jupiter</groupId>
              <artifactId>junit-jupiter-engine</artifactId>
              <version>${junit5.version}</version>
            </dependency>
            <dependency>
              <groupId>org.junit.vintage</groupId>
              <artifactId>junit-vintage-engine</artifactId>
              <version>4.12.0-M4</version>
            </dependency>
          </dependencies>
        </plugin>

The console has:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xwiki-platform-oldcore: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore && /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java -jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefirebooter7554021871729302969.jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire4900910245539098485tmp /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire_02307687931243988789tmp
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xwiki-platform-oldcore: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore && /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java -jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefirebooter7554021871729302969.jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire4900910245539098485tmp /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire_02307687931243988789tmp
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
	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:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
	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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore && /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java -jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefirebooter7554021871729302969.jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire4900910245539098485tmp /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire_02307687931243988789tmp
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 20 more
Caused by: java.lang.RuntimeException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore && /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java -jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefirebooter7554021871729302969.jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire4900910245539098485tmp /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefire_02307687931243988789tmp
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:590)
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:460)
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:229)
	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:201)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1026)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:862)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:755)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

To reproduce:

Thanks!

@vmassol
Copy link
Author

vmassol commented May 4, 2017

Would be great if this could be fixed for M5. This is currently preventing us from starting to use JUnit5 (using the vintage engine).

Any thought on this? Thanks a lot!

@sormuras
Copy link
Member

sormuras commented May 4, 2017

Hi @vmassol -- I am no Maven/Surefire expert. But I don't see a class from our JUnit Platform Surefire Provider in the stacktrace you posted.

See section 4.2.2. Maven for configuration steps. Or this answered SO question: http://stackoverflow.com/questions/36970384/surefire-is-not-picking-up-junit-5-tests

Hope that helps.

@vmassol
Copy link
Author

vmassol commented May 4, 2017

@sormuras Thanks. Here's what I do more precisely:

Step 1: Run "mvn clean install" on https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-oldcore with the following surefire configuration:

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
          <configuration>
            <trimStackTrace>false</trimStackTrace>
            <includes>
              <include>**/*Test.class</include>
            </includes>
          </configuration>
        </plugin>

Result: passing

Step 2: Run "mvn clean install" again but with the following changes to the pom.xml:

<junit5.version>5.0.0-M4</junit5.version>
...
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
          <configuration>
            <trimStackTrace>false</trimStackTrace>
            <includes>
              <include>**/*Test.class</include>
            </includes>
          </configuration>
          <dependencies>
            <!-- Allow running both JUnit4 and JUnit5 tests -->
            <dependency>
              <groupId>org.junit.platform</groupId>
              <artifactId>junit-platform-surefire-provider</artifactId>
              <version>1.0.0-M4</version>
            </dependency>
            <dependency>
              <groupId>org.junit.jupiter</groupId>
              <artifactId>junit-jupiter-engine</artifactId>
              <version>${junit5.version}</version>
            </dependency>
            <dependency>
              <groupId>org.junit.vintage</groupId>
              <artifactId>junit-vintage-engine</artifactId>
              <version>4.12.0-M4</version>
            </dependency>
          </dependencies>
        </plugin>
...
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit5.version}</version>
      </dependency>

Result: Failing

This is full error with Maven executed with -X: https://gist.github.com/vmassol/358a0bcbb2c55f9172aa067c346aa6c2

This is the surefire configuration from the execution with Maven with -X:
https://gist.github.com/vmassol/5214aa7c8cfe9888497a174ce281daa6

As you can see at line 76 (https://gist.github.com/vmassol/5214aa7c8cfe9888497a174ce281daa6#file-gistfile1-txt-L76), it says Using configured provider org.junit.platform.surefire.provider.JUnitPlatformProvider which seems to correspond to https://github.com/junit-team/junit5/blob/master/junit-platform-surefire-provider/src/main/java/org/junit/platform/surefire/provider/JUnitPlatformProvider.java

Since the only change in step2 is the change to use junit5 and junit5 surefire provider and the vintage engine, it seems to me that there's a problem somewhere in it causing the test to fail.

Unless you see some error in the way I configured junit5 to run our junit4 tests with Maven. But AFAIK I've followed the documentation and it works fine for building hundreds of other maven modules. It just fails on this one for some reason.

Thanks for your help.

@vmassol
Copy link
Author

vmassol commented May 4, 2017

My guess is that the org.junit.platform.surefire.provider.JUnitPlatformProvider is somehow behaving differently than the default surefire provider for some condition.

@marcphilipp
Copy link
Member

@Tibor17 Do you have an idea how to debug this?

@Tibor17
Copy link

Tibor17 commented May 4, 2017

@marcphilipp
Try to use version 2.20 and folow the message. It tells you to lookup .dump files in target folder with root cause happened in the fork.

@Tibor17
Copy link

Tibor17 commented May 4, 2017

target/surefire-reports

@marcphilipp
Copy link
Member

@vmassol Can you try using the latest snapshots of all JUnit 5 artifacts and see if the issue is still present?

@vmassol
Copy link
Author

vmassol commented May 4, 2017

@marcphilipp will do ASAP and report back, thanks

@vmassol
Copy link
Author

vmassol commented May 5, 2017

@marcphilipp could you tell me where to get the latest snapshots? I've found the CI job at https://junit.ci.cloudbees.com/job/JUnit5/ but I don't see where the generated artifacts are deployed to.

In order to build with snapshots I need a maven repo (installing them by hand in my local repo is doable but is a pain). Thanks

@vmassol
Copy link
Author

vmassol commented May 5, 2017

@nipafx
Copy link
Contributor

nipafx commented May 5, 2017

@vmassol Maybe you took the wrong turn somewhere (the old junit5-... folders are really confusing)? Here are the recent snapshots of Vintage, for example, from yesterday.

@vmassol
Copy link
Author

vmassol commented May 5, 2017

Thanks @nicolaiparlog , indeed I got confused initially but found the right artifacts by following the artifact ids from my pom :) Thx

@vmassol
Copy link
Author

vmassol commented May 5, 2017

ok I've tried by adding the following to my pom.xml:

  <repositories>
    <repository>
      <id>sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>sonatype-snapshots2</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </pluginRepository>
  </pluginRepositories>

And I get:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xwiki-platform-oldcore: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test: java.lang.NoSuchMethodError: org.apache.maven.surefire.util.internal.StringUtils.requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

Any idea?

@vmassol
Copy link
Author

vmassol commented May 5, 2017

Maybe the snapshot version of the junit provider is not compatible with surefire 2.19.1 anymore?

@marcphilipp
Copy link
Member

Yes, you have to switch to Surefire 2.20.

@vmassol
Copy link
Author

vmassol commented May 5, 2017

ok so I get some more info:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.xpn.xwiki.api.ContextTest
[WARNING] Corrupted stdin stream in forked JVM 1. See the dump file /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire-reports/2017-05-05T12-45-35_316-jvmRun1.dumpstream
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.174 s - in com.xpn.xwiki.api.ContextTest
[INFO] Running com.xpn.xwiki.api.DocumentTest
....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:30 min
[INFO] Finished at: 2017-05-05T12:48:45+02:00
[INFO] Final Memory: 63M/1901M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project xwiki-platform-oldcore: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore && /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java -jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefirebooter7006702630248129724.jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire 2017-05-05T12-45-35_316-jvmRun1 surefire7277459393638560763tmp surefire_05454144741541036778tmp
[ERROR] Crashed tests:
[ERROR] com.xpn.xwiki.internal.xml.DOMXMLWriterTest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore && /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java -jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire/surefirebooter7006702630248129724.jar /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/target/surefire 2017-05-05T12-45-35_316-jvmRun1 surefire7277459393638560763tmp surefire_05454144741541036778tmp
[ERROR] Crashed tests:
[ERROR] com.xpn.xwiki.internal.xml.DOMXMLWriterTest
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:679)
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:279)
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
[ERROR] 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] 	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[ERROR] 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[ERROR] 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[ERROR] 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[ERROR] 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

The dump file has tons of those:

# Created on 2017-05-05T12:45:38.840
Corrupted stdin stream in forked JVM 1. Stream '12:45:38.836 [main] ERROR c.x.x.objects.classes.PropertyClass - Error while trying to evaluate if a property has a custom displayer'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '12:45:38.836 [main] ERROR c.x.x.objects.classes.PropertyClass - Error while trying to evaluate if a property has a custom displayer'.
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:469)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:191)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:158)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:87)
        at java.lang.Thread.run(Thread.java:745)


# Created on 2017-05-05T12:45:38.841
Corrupted stdin stream in forked JVM 1. Stream 'java.lang.RuntimeException: Failed to load component for type [interface org.xwiki.template.TemplateManager] for hint [default]'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command 'java.lang.RuntimeException: Failed to load component for type [interface org.xwiki.template.TemplateManager] for hint [default]'.
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:469)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:191)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:158)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:87)
        at java.lang.Thread.run(Thread.java:745)

Any idea why this is passing fine with standard surefire but failing when using the junit5 surefire provider?

Thanks! We're getting closer...

@vmassol
Copy link
Author

vmassol commented May 5, 2017

So the new thread dump stuff seems to be something new in surefire 2.20 (We also got it when trying to upgrade our build to surefire 2.20: https://jira.xwiki.org/browse/XCOMMONS-1190).

However the "The forked VM terminated without properly saying goodbye. VM crash or System.exit called?" is still there even when using the latest junit5 snapshot.

@Tibor17
Copy link

Tibor17 commented May 5, 2017 via email

@Tibor17
Copy link

Tibor17 commented May 5, 2017 via email

@vmassol
Copy link
Author

vmassol commented May 5, 2017

Thanks! I'll try to understand that more and review our tests to check this out. What logger are you referring to BTW?

However on this comment https://issues.apache.org/jira/browse/SUREFIRE-1359?focusedCommentId=15969287&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15969287 you say that it shouldn't fail the build.

So I'm still facing the issue of "The forked VM terminated without properly saying goodbye. VM crash or System.exit called?" which happens with junit5/vintage.

@vmassol
Copy link
Author

vmassol commented May 5, 2017

So to make it clear:

  • Regarding "the logger" you were referring to the log appearing in the content of the dump file. So tests are not allowed to log anything to the console anymore? However this is not failing the build and is not related to this junit5 issue per see. However when executing with plain surefire I get to see the logs printed on the console and they're not with the junit5 surefire provider so that's another difference that should probably be fixed in junit5/vintage codebase:
[INFO] Running com.xpn.xwiki.api.ContextTest
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.064 s - in com.xpn.xwiki.api.ContextTest
[INFO] Running com.xpn.xwiki.api.DocumentTest
13:46:09.791 [main] WARN  com.xpn.xwiki.doc.XWikiDocument - Failed to find parser for the default syntax [XWiki 1.0]. Defaulting to xwiki/2.1 syntax.
13:46:09.848 [main] WARN  com.xpn.xwiki.doc.XWikiDocument - Failed to find parser for the default syntax [XWiki 1.0]. Defaulting to xwiki/2.1 syntax.
13:46:09.884 [main] WARN  com.xpn.xwiki.doc.XWikiDocument - Failed to find parser for the default syntax [XWiki 1.0]. Defaulting to xwiki/2.1 syntax.
13:46:09.907 [main] WARN  com.xpn.xwiki.doc.XWikiDocument - Failed to find parser for the default syntax [XWiki 1.0]. Defaulting to xwiki/2.1 syntax.
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.367 s - in com.xpn.xwiki.api.DocumentTest

Thanks

@marcphilipp
Copy link
Member

The JUnit platform logs a few things (e.g. which engines are present) to stdin/stderr. You should be able to install a custom JUL LogManager (e.g. Log4J) and provide a config that suppresses all logging. Does that help?

@Tibor17
Copy link

Tibor17 commented May 5, 2017 via email

@vmassol
Copy link
Author

vmassol commented May 6, 2017

If you have any mechanism, like static code init, you can easily fetch
System.out beforehand and this means you cached PrintStream and later you
wrote bytes to the native stream and this is the issue.

ok that must be it. We do have code like this using SLF4J:

    private static final Logger LOGGER = LoggerFactory.getLogger(XWikiDocument.class);

I don't know what SLF4J does but maybe it caches PrintStream.

@Tibor17
Copy link

Tibor17 commented Apr 12, 2018 via email

@sormuras
Copy link
Member

Tried to insert <scope>test</scope> in both JUnit 5 samples and removed the dependencies from the sure plugin configuration ... and they still fail with ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger

Index: junit5-forkmode-always/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- junit5-forkmode-always/pom.xml	(revision fde3538877f4c48650b46d102a0abaeb35001992)
+++ junit5-forkmode-always/pom.xml	(date 1523563308331)
@@ -30,23 +30,27 @@
       <groupId>org.junit.platform</groupId>
       <artifactId>junit-platform-runner</artifactId>
       <version>${junit.platform.version}</version>
+      <scope>test</scope>
     </dependency>
     <!-- junit jupiter -->
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
       <version>${junit.jupiter.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-params</artifactId>
       <version>${junit.jupiter.version}</version>
+      <scope>test</scope>
     </dependency>
     <!-- junit vintage -->
     <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
       <version>${junit.vintage.version}</version>
+      <scope>test</scope>
     </dependency>
   </dependencies>
 
@@ -64,16 +68,6 @@
             <groupId>org.junit.platform</groupId>
             <artifactId>junit-platform-surefire-provider</artifactId>
             <version>${junit.platform.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-engine</artifactId>
-            <version>${junit.jupiter.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.junit.vintage</groupId>
-            <artifactId>junit-vintage-engine</artifactId>
-            <version>${junit.vintage.version}</version>
           </dependency>
         </dependencies>
       </plugin>
Index: junit5-forkcount-1/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- junit5-forkcount-1/pom.xml	(revision fde3538877f4c48650b46d102a0abaeb35001992)
+++ junit5-forkcount-1/pom.xml	(date 1523563246445)
@@ -30,23 +30,27 @@
       <groupId>org.junit.platform</groupId>
       <artifactId>junit-platform-runner</artifactId>
       <version>${junit.platform.version}</version>
+      <scope>test</scope>
     </dependency>
     <!-- junit jupiter -->
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
       <version>${junit.jupiter.version}</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-params</artifactId>
       <version>${junit.jupiter.version}</version>
+      <scope>test</scope>
     </dependency>
     <!-- junit vintage -->
     <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
       <version>${junit.vintage.version}</version>
+      <scope>test</scope>
     </dependency>
   </dependencies>
 
@@ -65,16 +69,6 @@
             <groupId>org.junit.platform</groupId>
             <artifactId>junit-platform-surefire-provider</artifactId>
             <version>${junit.platform.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-engine</artifactId>
-            <version>${junit.jupiter.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.junit.vintage</groupId>
-            <artifactId>junit-vintage-engine</artifactId>
-            <version>${junit.vintage.version}</version>
           </dependency>
         </dependencies>
       </plugin>

@Tibor17
Copy link

Tibor17 commented Apr 12, 2018 via email

@Tibor17
Copy link

Tibor17 commented Apr 12, 2018 via email

@sormuras
Copy link
Member

Excerpt from junit-platform-surefire-provider-1.1.1.pom:

<project>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
[...]
<dependencies>
[...]
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-api</artifactId>
<version>2.19.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>common-java5</artifactId>
<version>2.19.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>

I guess, you refer to these scopes?

  • Yes. Now you do understand. ▶️ What other scope should we set here? test?
  • No. You still do not understand. ▶️ Please try to explain what we can do to always include the surefire-logger-api dependency at ... test runtime. What ever the mode may be.

@Tibor17
Copy link

Tibor17 commented Apr 13, 2018 via email

@sormuras
Copy link
Member

Please add further questions, findings and solutions regarding the fork mode issue with the JUnit Platform Surefire Provider to #1367

Thanks.

@sbrannen
Copy link
Member

Thanks, @Tibor17 and @sormuras!

@sbrannen
Copy link
Member

I will squash junit5 into a new branch as it seems to be more important
than Maven3 and we can go out with surefire version 2.22.0.
Let's see what the tests would say on CI.

Looking forward to it! 👏

@Tibor17
Copy link

Tibor17 commented Apr 13, 2018 via email

@Tibor17
Copy link

Tibor17 commented Apr 13, 2018 via email

@Tibor17
Copy link

Tibor17 commented Apr 13, 2018 via email

@sbrannen
Copy link
Member

Great, @Tibor17!

Thanks for taking the initiative!

joakime added a commit to jetty/jetty.project that referenced this issue Jun 14, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 13, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 16, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 24, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 25, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 29, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 29, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Aug 31, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Sep 4, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Sep 4, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.21.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Sep 4, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Sep 5, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
olamy pushed a commit to jetty/jetty.project that referenced this issue Sep 5, 2018
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug junit-team/junit5#801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@before      | @beforeeach
@after       | @AfterEach
@BeforeClass | @BeforeAll
@afterclass  | @afterall

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants