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:
mvn clean install -rf xwiki-platform-core/xwiki-platform-oldcore/Thanks!
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!
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.
@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.
My guess is that the org.junit.platform.surefire.provider.JUnitPlatformProvider is somehow behaving differently than the default surefire provider for some condition.
@Tibor17 Do you have an idea how to debug this?
@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.
target/surefire-reports
@vmassol Can you try using the latest snapshots of all JUnit 5 artifacts and see if the issue is still present?
@marcphilipp will do ASAP and report back, thanks
@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 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.
Thanks @nicolaiparlog , indeed I got confused initially but found the right artifacts by following the artifact ids from my pom :) Thx
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?
Maybe the snapshot version of the junit provider is not compatible with surefire 2.19.1 anymore?
Yes, you have to switch to Surefire 2.20.
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:
````
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.
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)
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.
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...
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.
You must be doing something in the fork like sending bytes to native
std/out via {{FileDescriptor.out}} or {{ProcessBuilder and inherited
channel}}.
On Fri, May 5, 2017 at 1:08 PM, Vincent Massol notifications@github.com
wrote:
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.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299438214,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRyoYaiC4NeSH8Tw_rCNcpjgki9kxks5r2wMhgaJpZM4NEluL
.
--
Cheers
Tibor
I guess it's the logger.
On Fri, May 5, 2017 at 1:15 PM, Tibor Digana tibor.digana@googlemail.com
wrote:
You must be doing something in the fork like sending bytes to native
std/out via {{FileDescriptor.out}} or {{ProcessBuilder and inherited
channel}}.On Fri, May 5, 2017 at 1:08 PM, Vincent Massol notifications@github.com
wrote: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.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299438214,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRyoYaiC4NeSH8Tw_rCNcpjgki9kxks5r2wMhgaJpZM4NEluL
.--
Cheers
Tibor
--
Cheers
Tibor
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.
So to make it clear:
[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
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?
See ForkedBooter class in surefire.
We are overriding system out/err in the beginning of the main() method.
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.
On Fri, May 5, 2017 at 4:24 PM, Marc Philipp notifications@github.com
wrote:
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?โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299478639,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRwJJ35wBDlw6PfsC-9_qQfktGNG-ks5r2zEYgaJpZM4NEluL
.
--
Cheers
Tibor
If you have any mechanism, like static code init, you can easily fetch
System.outbeforehand 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.
I don't know what SLF4J does but maybe it caches PrintStream.
I think that depends on which implementation you bind into your test scope. If you don't provide an implementation, slf4j-nop will be used and I suspect it doesn't use System.out or System.err at all. It's also my recollection that slf4j-simple uses System.err though I can't comment on whether it's cached.
What happens if you comment out the logger?
On Sat, May 6, 2017 at 7:23 PM, Steve Moyer notifications@github.com
wrote:
I don't know what SLF4J does but maybe it caches PrintStream.
I think that depends on which implementation you bind into your test
scope. If you don't provide an implementation, slf4j-nop will be used and
I suspect it doesn't use System.out or System.err at all. It's also my
recollection that slf4j-simple uses System.err though I can't comment on
whether it's cached.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299654145,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR7JYymRXT49U7PJxlHbV0tnlM7rxks5r3KyjgaJpZM4NEluL
.
--
Cheers
Tibor
See this
https://jira.qos.ch/browse/SLF4J-395
https://jira.qos.ch/browse/SLF4J-389
and system property org.slf4j.simpleLogger.cacheOutputStream see the
Javadoc https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html
On Sat, May 6, 2017 at 9:56 PM, Tibor Digana tibor.digana@googlemail.com
wrote:
What happens if you comment out the logger?
On Sat, May 6, 2017 at 7:23 PM, Steve Moyer notifications@github.com
wrote:I don't know what SLF4J does but maybe it caches PrintStream.
I think that depends on which implementation you bind into your test
scope. If you don't provide an implementation, slf4j-nop will be used
and I suspect it doesn't use System.out or System.err at all. It's also
my recollection that slf4j-simple uses System.err though I can't comment
on whether it's cached.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299654145,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR7JYymRXT49U7PJxlHbV0tnlM7rxks5r3KyjgaJpZM4NEluL
.--
Cheers
Tibor
--
Cheers
Tibor
We have two issues here. One is corrupted stream and the second is some error which crashed forked jvm which can be seen in dump files *.dump and *.dumpstream.
See this in logs
[ERROR] Crashed tests:
[ERROR] com.xpn.xwiki.internal.xml.DOMXMLWriterTest
It is obvious that this test could not complete.
Maybe due to System.exit() .
The *.dumpstream is reported by Maven process because corrupted stream was received by ForkClient in Maven process. The *.dumpstream can be reported with another name if Maven process sends corrupted stream or forked jvm receives corrupted stream.
@Tibor17 The reason I raised this issue is because of the different surefire behavior I get when I run "mvn test" with the junit5 surefire provider (with the vintage engine) and when I run it without it. Without it, the test doesn't crash and the build is successful (even with surefire 2.20). So I raised this issue because I thought that you guys would be interested in ensuring the same behavior since it's supposed to be a drop-in replacement.
Now I'm not against working to fix whatever is making the junit5 surefire provider choke in our tests but that's beside the point of this issue. I do really appreciate all your comments to help me fix the issue in my tests though and I'll work to fix them.
WDYT? Is this something you're willing to explore fixing?
Thanks!
WDYT? Is this something you're willing to explore fixing?
Sure! However, right now I don't have any idea what causes Surefire to choke when using our provider.
@Tibor17 Do you?
We received blockers and we understood that people corrupt stream which is
used for surefire's internal communication. Dumping the steam which does
not have our markers is the way to prove it. We have also such users which
send such binary stream we recognize as ours and the plugin then hangs.
In the next release I am going to change the format of the stream and add
"magic number". If the magic number does not match then we are sure it is
not our stream and still can be avoided from processing it and would go to
.dumpstream file.
Much later in version 3.0 we will use sockets by default and this inter
process communication would be chosen by user configuration.
Receiving *.dumpstream file should not crash the jvm. This means there is
second problem in provider which can be found in another dump file
/target/surefire-reports/.dump or failsafe-reports directory.
On Sun, May 7, 2017 at 9:36 AM, Marc Philipp notifications@github.com
wrote:
WDYT? Is this something you're willing to explore fixing?
Sure! However, right now I don't have any idea what causes Surefire to
choke when using our provider.@Tibor17 https://github.com/Tibor17 Do you?
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299688237,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR9yiabLC4FZCEI_WfdHSqjb0Mzlzks5r3XRwgaJpZM4NEluL
.
--
Cheers
Tibor
I do not see the test DOMXMLWriterTest in JUnit 5 sources.
Is there any typo?
@vmassol
Try to add DOMXMLWriterTest.java with all dependencies it needs to have in a pull request or in separate project with POM and we all should have a look. But it must be isolated from all unnecessary dependencies and code.
I do not see the test DOMXMLWriterTest in JUnit 5 sources.
Is there any typo?
I'll try to create a smaller project to make it simpler for you to reproduce.
Thanks
-Vincent
Do you reproduce it with Java Agent like in Jenkins?
@marcphilipp
Do you have SNAPSHOT deployments in Maven Central?
Snapshots are here: https://oss.sonatype.org/content/repositories/snapshots
@vmassol
Pls add SNAPSHOT dependency to JUnit 5 and plugin repository URL.
Thx.
@Tibor17 Yes, I've been running junit5 SNAPSHOT artifacts since https://github.com/junit-team/junit5/issues/801#issuecomment-299276442. Have you made any recent change that you'd like me to test?
Do you reproduce it with Java Agent like in Jenkins?
Yes, the error was noticed on a jenkins agent. That's when I reverted my change to support junit5. See https://jira.xwiki.org/browse/XCOMMONS-1189?focusedCommentId=94726&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-94726 and the commits tab to see the commit and the reverts.
Thanks
@Tibor17 Here's a small project reproducing the problem I have:
Let me know if you can reproduce.
Comment out the following part of the pom.xml and it should pass successfully:
<!--dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.0.0-SNAPSHOT</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-SNAPSHOT</version>
</dependency>
</dependencies-->
Thanks
@vmassol
I've got this in dumpstream:
Unexpected IOException: 6,1,com.xpn.xwiki.internal.xml.DOMXMLWriterTest,writeVersusWriteOpen,null,null,null
and
Unexpected IOException: 2,1,org.junit.platform.surefire.provider.JUnitPlatformProvider,com.xpn.xwiki.internal.xml.DOMXMLWriterTest,null,null,null
The code 6 and 2 mean BOOTERCODE_TEST_SUCCEEDED and BOOTERCODE_TESTSET_COMPLETED.
This happens if PrintStream.checkError() returns true.
It could be any reason. For instance the stream was closed or anything else.
@vmassol
@marcphilipp
Now I changed the command to mvn test -DforkCount=0 -e -nsu and this is the exception:
Caused by: org.apache.maven.surefire.util.SurefireReflectionException: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
at org.apache.maven.plugin.surefire.CommonReflector.<init>(CommonReflector.java:56)
at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:78)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1060)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:98)
at org.apache.maven.plugin.surefire.CommonReflector.<init>(CommonReflector.java:52)
... 26 more
AFter I have removed the plugin dependencies I get:
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
@Tibor17 Thanks for looking into this. I'm trying to understand your last 2 messages and whether there's something I can do on my side to make the test pass with junit5+vintage? I don't understand why you're getting this exception in your last test and why surefire would miss some class. Any idea?
Thanks!
@vmassol
@marcphilipp
hm, why you use the dependencies within the plugin?
It must not be there!
The classloader in provider and plugin itself are two different and therefore all dependencies must be in the project, like it always was with junit:4.12 using the scope test.
What you can do is to deploy BOM like Arquillian Universe having dependencyManagement. Once you have it in your POM you can inherit a bunch of dependencies which play the same role. This way one dependency would fetch multiple dependencies and versions which are consistent.
@Tibor17 I'm not sure what dependency you're referring to... I'm just following the junit5 tutorial for maven, see section 4.2.2 in http://junit.org/junit5/docs/current/user-guide/#running-tests-build
So I have which matches the doc AFAICS:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<!-- XWiki rule is to put test in *Test classes -->
<configuration>
<!-- We want to show nested stack traces to see what is the real problem when a test fails! -->
<trimStackTrace>false</trimStackTrace>
<includes>
<include>**/*Test.class</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.0.0-SNAPSHOT</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-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
What's wrong?
Thanks
If the provider junit-platform-surefire-provider is in plugins dependencies the provider crashes.
I have no idea why it fails but providers like surefire-junit47 was always documented in plugin dependencies, but not the other dependencies. The provider has SPI and such jar is added to IsolatedClassLoader or to the Manifest of jar of forked JVM.
I've been using that configuration for months and am not having the problem experienced by @vmassol. I'm still using version 2.19.1 of the maven-surefire-plugin with JUnit 5 version M4.
Now I used Surefire version 2.19.1 with command mvn test -nsu -DforkCount=0 and the result is different.
There is difference against 2.20 because you do NOT see test summary.
It looks to me like System.exit, notice I used forkCount=0 in CLI.
```
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ xwiki-platform-oldcore ---
[WARNING] useSystemClassloader setting has no effect when not forking
Running com.xpn.xwiki.internal.xml.DOMXMLWriterTest
e:\tmp\xwiki-junit5-vintage>```
@smoyer64 Do not use dependencies within plugin except for provider.
After I removed only provider junit-platform-surefire-provider the test passed successfully.
@Tibor17 I don't understand. If I remove junit-platform-surefire-provider then how does surefire know that it should use the junit5 surefire provider?
In the logs (maven executed with -X) I see it's not using it:
```
[DEBUG] provider classpath: /Users/vmassol/.m2/repository/org/apache/maven/surefire/surefire-junit4/2.20/surefire-junit4-2.20.jar /Users/vmassol/.m2/repository/org/apache/maven/surefire/surefire-api/2.20/surefire-api-2.20.jar /Users/vmassol/.m2/repository/org/apache/maven/surefire/surefire-logger-api/2.20/surefire-logger-api-2.20.jar
````
So I'm pretty sure junit5 wasn't executed...
@Tibor17 could you paste my modified POM so that I can understand what I should use? Thanks!
Add junit:junit:4.12 instead. With junit5 there are two issues
ClassNotFound (forkCount=0), and PrintStream checkError() return true
otherwise.
On Mon, May 8, 2017 at 3:27 PM, Vincent Massol notifications@github.com
wrote:
@Tibor17 https://github.com/Tibor17 could you paste my modified POM so
that I can understand what I should use? Thanks!โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299866504,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR1soRJJrAPKDIhigOetbG-L_eflGks5r3xhWgaJpZM4NEluL
.
--
Cheers
Tibor
Any bytecode manipulation, mocking/intercepting and changing ClassLoaders?
Could be ClassNotFoundError.
On Mon, May 8, 2017 at 4:22 PM, Tibor Digana tibor.digana@googlemail.com
wrote:
Add junit:junit:4.12 instead. With junit5 there are two issues
ClassNotFound (forkCount=0), and PrintStream checkError() return true
otherwise.On Mon, May 8, 2017 at 3:27 PM, Vincent Massol notifications@github.com
wrote:@Tibor17 https://github.com/Tibor17 could you paste my modified POM so
that I can understand what I should use? Thanks!โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299866504,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR1soRJJrAPKDIhigOetbG-L_eflGks5r3xhWgaJpZM4NEluL
.--
Cheers
Tibor
--
Cheers
Tibor
@Tibor17 sorry but I still don't understand what you mean. My whole goal is to be able to run both junit4 and junit5 tests at the same time (that's why I added the junit5 vintage engine). Isn't that possible?
Re junit 4, I already have the dep in the pom.
In all my posts you could see how I isolated components and identified
problems. The root cause must be found by JUnit5.
On Mon, May 8, 2017 at 4:41 PM, Vincent Massol notifications@github.com
wrote:
@Tibor17 https://github.com/Tibor17 sorry but I still don't understand
what you mean. My whole goal is to be able to run both junit4 and junit5
tests at the same time (that's why I added the junit5 vintage engine).
Isn't that possible?Re junit 4, I already have the dep in the pom.
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299886385,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRzAZ7zZbzqeYGNdXZFO1Vu7eWsHFks5r3ymTgaJpZM4NEluL
.
--
Cheers
Tibor
@Tibor17 so I've tried to reduce the test to the minimum and here's a test that makes junit5 w/ vintage fails:
````
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
public class WriterTest
{
@Test
public void writerClose() throws IOException
{
Writer writer = new BufferedWriter(new OutputStreamWriter(System.out));
writer.close();
}
}
`````
Maybe that can help trace the problem?
FTR this is what DOM4J does (it's used by XWiki):
public XMLWriter() {
this.resolveEntityRefs = true;
this.lastElementClosed = false;
this.preserve = false;
this.namespaceStack = new NamespaceStack();
this.escapeText = true;
this.indentLevel = 0;
this.buffer = new StringBuffer();
this.charsAdded = false;
this.format = DEFAULT_FORMAT;
this.writer = new BufferedWriter(new OutputStreamWriter(System.out));
this.autoFlush = true;
this.namespaceStack.push(Namespace.NO_NAMESPACE);
}
Thanks
So I guess the issue is that it closes the replacement of System.out done by the JUnit5 surefire provider, and then the provider tries to do something on it but failing since it's closed already. Or something like this...
My whole goal is to be able to run both junit4 and junit5 tests at the same time (that's why I added the junit5 vintage engine). Isn't that possible?
It sure is!
The JUnit 5 Surefire provider does not replace System.out. But we need more time to look into this issue as everyone is busy with their day jobs.
@vmassol - Do you really want to close System.out in your test? Looking at ForkStarter.java in the maven-surefire-plugin source code, it looks like Surefire pipes the forked process' OutputStream into the controlling process. I've briefly gone through the class and I'm thinking that by closing System.out you're also preventing the communication between the parent and child. Can you try commenting just that line out and run it?
This is pipe. Especially if we closed System.in in the fork, the
CommandReader is closed consequently and it suggested the Maven process was
stopped by CTRL+C, the testset the interrupted, ForkStarter will see that
event BYE has not been sent from the fork, and some test crashed in the
middles "Crashed tests:".
On Mon, May 8, 2017 at 10:30 PM, Steve Moyer notifications@github.com
wrote:
@vmassol https://github.com/vmassol - Do you really want to close
System.out in your test? Looking at ForkStarter.java in the
maven-surefire-plugin source code, it looks like Surefire pipes the
forked process' OutputStream into the controlling process. I've briefly
gone through the class and I'm thinking that by closing System.out you're
also preventing the communication between the parent and child. Can you try
commenting just that line out and run it?โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-299981826,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR-UcsN8jxfygaVWdOen7X9gcZl80ks5r33txgaJpZM4NEluL
.
--
Cheers
Tibor
But we need more time to look into this issue as everyone is busy with their day jobs.
@marcphilipp I wanted to apologize if I appeared to be pushy. That wasn't my intent. TBH you guys are amazing. You've kept answering all my messages promptly and even during your weekend! Kudos to you all.
Do you really want to close System.out in your test?
@smoyer64 No I do not want this. It appears that we used the default constructor of DOM4J's XMLWriter in XWiki's code and that default constructor uses System.out as the output stream. I've now refactored our code to not use that constructor and instead to pass some other output stream. The problem no longer appears.
@Tibor17 I'll let you guys decide what you want to do regarding this issue. I guess you could prevent some unit test code from closing the stream that you're replacing System.out with.
Thanks
Can you show me in GitHub what exactly was your change?
I guess more users may do the same.
On Mon, May 8, 2017 at 11:46 PM, Vincent Massol notifications@github.com
wrote:
Do you really want to close System.out in your test?
@smoyer64 https://github.com/smoyer64 No I do not want this. It appears
that we used the default constructor of DOM4J's XMLWriter in XWiki's code
and that default constructor uses System.out as the output stream. I've now
refactored our code to not use that constructor and instead to pass some
other output stream. The problem no longer appears.I'll let you guys decide what you want to do regarding this issue. I guess
you could prevent some unit test code from closing the stream that you're
replacing System.out with.Thanks
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-300000302,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR63rRVXRn_0TAlyyQdXWB3bJMGMkks5r340-gaJpZM4NEluL
.
--
Cheers
Tibor
Looks like the change is done in https://github.com/xwiki/xwiki-platform/commit/1eb6481f4e063a48cfb889b51b0b4a5b89a51a31
@vmassol - I'm glad to hear your problem has been solved!
I'm going to have to take a look at some of my code too as I have a JUnit 5 extension that allows the testing of what's sent to the stdout and stderr. I suspect there are two factors that have kept me from experiencing this problem. So far, JUnit 5 doesn't run tests in parallel, so it doesn't need to fork another JVM process. And even once it does, I think the JVM will keep it's reference to System.out and continue to communicate with the parent process after I've started capturing the output from my application. I guess we'll see!
ok, I have a new problem now but it seems different. Seems using surefire 2.20 + JUnit5 is causing a java heap space issue, see https://jira.xwiki.org/browse/XCOMMONS-1189?focusedCommentId=94953&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-94953
Note that running the exact same build by commenting out the following part doesn't exhibit the "Java Heap Space" issue so for some reason the junit5 provider is eating more memory. FTR I'm running with MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=196m" which is already quite substantial so it could be a memory leak somewhere.
````
...
`````
Let me know if you'd like me to open a new issue. Thanks
Let me know if you'd like me to open a new issue.
Please do!
Just in case someone else is struggling with a similar problem, in my case, I observed that using the latest version (2.20.1) of maven-surefire-plugin instead of 2.19.1 fixed my problem.
@shatu Thanks for the update. I've just tried to update to 2.20.1 and I'm still getting errors:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project xwiki-commons-tool-verification-resources: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/vmassol/dev/xwiki/xwiki-commons/xwiki-commons-tools/xwiki-commons-tool-verification-resources/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] There was an error in the forked process
[ERROR] org.apache.maven.surefire.report.RunListener.testSetStarting(Lorg/apache/maven/surefire/report/ReportEntry;)V
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] org.apache.maven.surefire.report.RunListener.testSetStarting(Lorg/apache/maven/surefire/report/ReportEntry;)V
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:673)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)
[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:955)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
[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)
I'm getting the exact same trace as the above with 2.20.1:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:integration-test (default) on project <snip>: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:integration-test failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:integration-test (default) on project sage-web: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:integration-test failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
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 of goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:integration-test failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
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: org.apache.maven.surefire.util.SurefireReflectionException: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
at org.apache.maven.plugin.surefire.CommonReflector.<init>(CommonReflector.java:56)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.getSuitesIterator(ForkStarter.java:708)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkPerTestSet(ForkStarter.java:405)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:295)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:100)
at org.apache.maven.plugin.surefire.CommonReflector.<init>(CommonReflector.java:52)
... 29 more
Using:
<properties>
<surefire.plugin.version>2.20.1</surefire.plugin.version>
<failsafe.plugin.version>2.20.1</failsafe.plugin.version>
...
<junit.version>4.12</junit.version>
<junit.jupiter.version>5.0.3</junit.jupiter.version>
<junit.vintage.version>${junit.version}.3</junit.vintage.version>
<junit.platform.version>1.0.3</junit.platform.version>
</properties>
...
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<reuseForks>false</reuseForks>
<encoding>UTF-8</encoding>
<includes>
<include>**/integration/**/*.java</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
</dependency>
</dependencies>
</plugin>
...
To summarize, what is the suggested fixed for this?
Debugging this a bit more, I have determined that with:
<reuseForks>true</reuseForks>
my build succeeds as expected.
The Eclipse Jetty project just hit this issue with the ConsoleLogger in our recent junit5 migration. (eclipse/jetty.project#2431)
We would see ...
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLoggertarget/surefire-reports directoryWe were able to limp past this with adding an entry to our build.dependencies along the lines of ...
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-logger-api</artifactId>
<version>2.21.0</version>
<!-- to get around bug https://github.com/junit-team/junit5/issues/801 -->
<scope>test</scope>
<optional>true</optional>
</dependency>
At which point we would see the target/surefire-reports directory and a hint on what was causing the issue ...
[jetty-webapp]$ cat cat target/surefire-reports/2018-04-11T08-59-14_946.dumpstream
# Created on 2018-04-11T08:59:14.948
WARNING: An illegal reflective access operation has occurred
# Created on 2018-04-11T08:59:14.953
WARNING: Illegal reflective access by org.eclipse.jetty.webapp.URLStreamHandlerUtil (file:/C:/code/jetty/jetty.project-9.4.x/jetty-webapp/target/test-classes/) to field java.net.URL.factory
# Created on 2018-04-11T08:59:14.959
WARNING: Please consider reporting this to the maintainers of org.eclipse.jetty.webapp.URLStreamHandlerUtil
# Created on 2018-04-11T08:59:14.965
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
# Created on 2018-04-11T08:59:14.971
WARNING: All illegal access operations will be denied in a future release
Which is a legitimate warning, from Java 9+, about bad usages of .setAccessible() in our test cases.
It almost (but not quite exactly) appears to be outputted using java.util.logging?
I went ahead and distilled this specific issue down to the minimum project that I could to replicate the crash.
Available at: https://github.com/jetty-project/junit-issue-801
You will see the reported crash on JDK 9, JDK 10, and JDK 11.
Note, the sample project https://github.com/jetty-project/junit-issue-801
will also fail on JDK 8 on Windows ...
> mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T14:39:06-05:00)
Maven home: C:\java\apache-maven-3.5.0\bin\..
Java version: 1.8.0_162, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_162\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
> mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building junit-issue-801 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ junit-issue-801 ---
[INFO] Deleting C:\code\jetty\github\junit-issue-801\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ junit-issue-801 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\junit-issue-801\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ junit-issue-801 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\code\jetty\github\junit-issue-801\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ junit-issue-801 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\junit-issue-801\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ junit-issue-801 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\code\jetty\github\junit-issue-801\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ junit-issue-801 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.784 s
[INFO] Finished at: 2018-04-11T09:56:09-05:00
[INFO] Final Memory: 17M/414M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project junit-issue-801: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.log.api.ConsoleLogger -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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
Strange, when you browse to https://maven.apache.org/surefire/maven-surefire-common/apidocs/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.html and click on the link referred by implements org.apache.maven.plugin.surefire.log.api.ConsoleLogger, you also get an error page. @Tibor17 is the api package not jarred or does it ship in another artifact?
I could fix the demo project provided by @joakime by adding
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-logger-api</artifactId>
<version>2.21.0</version>
</dependency>
manually. Now it reports (using JDK 10 on Windows 10):
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ junit-issue-801 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running demo.URLStreamHandlerUtilTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.015 s <<< FAILURE! - in demo.URLStreamHandlerUtilTest
[ERROR] testGetFactory Time elapsed: 0.015 s <<< FAILURE!
org.opentest4j.AssertionFailedError: Should not have been null ==> expected: not <null>
at demo.URLStreamHandlerUtilTest.testGetFactory(URLStreamHandlerUtilTest.java:11)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] URLStreamHandlerUtilTest.testGetFactory:11 Should not have been null ==> expected: not <null>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.253 s
[INFO] Finished at: 2018-04-11T18:29:17+02:00
[INFO] Final Memory: 11M/50M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project junit-issue-801: There are test failures.
Sorry, didn't see you already found and included the surefire-logger-api in your build.
If I am not mistaken, JUnit can't do anything about it. The surefire plugin should bring all of its deps with it, maybe it's already fixed in their SNAPSHOT builds?
Can somebody provide me with a link where I can download a simple project
reproducing this issue?
Thx.
On Wed, Apr 11, 2018 at 6:43 PM, Christian Stein notifications@github.com
wrote:
Sorry, didn't see you already found and included the surefire-logger-api
in your build.If I am not mistaken, JUnit can't do anything about it. The surefire
plugin should bring all of its deps with it, maybe it's already fixed in
their SNAPSHOT builds?โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380518825,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR1HKmDiKBZmGVjHb5JsN5IOk2BXOks5tnjKcgaJpZM4NEluL
.
--
Cheers
Tibor
Can somebody provide me with a link where I can download a simple project
reproducing this issue?
@sormuras what happens when surefire-logger-api is a dependency of junit-platform-surefire-provider ?
You should delete two dependencies within plugin section in the POM and
keep the provider only. You already have them in project dependencies.
The problem happens when reuseForks=false and forkCount=1.
Obviously there must be a problem with transitive dependencies. I do not
think it is packages shading problem.
On Wed, Apr 11, 2018 at 10:01 PM, Joakim Erdfelt notifications@github.com
wrote:
@sormuras https://github.com/sormuras what happens when
surefire-logger-api is a dependency of junit-platform-surefire-provider ?โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380577796,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yR7LVfGnCOlKglZSoOlHxAmvZLV4Yks5tnmE1gaJpZM4NEluL
.
--
Cheers
Tibor
what happens when surefire-logger-api is a dependency of
junit-platform-surefire-provider?
I guess that would act as a band-aid and by-pass the underlying problem.
There is a working configuration: if you set <reuseForks>true</reuseForks>, like you did in 582075e, everything's fine. The api package is available, because the artifact surefire-logger-api is resolved.
But this combination with reuseForks=false should work as well. Has
somebody tried a prototype with old JUnit 4.12 and same config?
On Thu, Apr 12, 2018 at 8:33 AM, Christian Stein notifications@github.com
wrote:
what happens when surefire-logger-api is a dependency of
junit-platform-surefire-provider?I guess that would act as a band-aid and by-pass the underlying problem.
There is a working configuration: if you set
true ,
like you did in 582075e, everything's fine. The api package is available,
because the artifact surefire-logger-api is resolved.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380694126,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRxrUGuFFKMfKviNJH9GARyMzDVwfks5tnvVFgaJpZM4NEluL
.
--
Cheers
Tibor
Pls check it out in debug mode (mvn -X test). You will see classpath for
surefire and you can see what is missing when changing the config.
On Thu, Apr 12, 2018 at 8:44 AM, Tibor Digana tibor.digana@googlemail.com
wrote:
But this combination with reuseForks=false should work as well. Has
somebody tried a prototype with old JUnit 4.12 and same config?On Thu, Apr 12, 2018 at 8:33 AM, Christian Stein <[email protected]
wrote:
what happens when surefire-logger-api is a dependency of
junit-platform-surefire-provider?I guess that would act as a band-aid and by-pass the underlying problem.
There is a working configuration: if you set
true , like you did in 582075e, everything's
fine. The api package is available, because the artifact
surefire-logger-api is resolved.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380694126,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRxrUGuFFKMfKviNJH9GARyMzDVwfks5tnvVFgaJpZM4NEluL
.--
Cheers
Tibor
--
Cheers
Tibor
what happens when
surefire-logger-apiis a dependency ofjunit-platform-surefire-provider?
If the JUnit Platform provider is not directly using the surefire-logger-api, then it would not be the job of JUnit to include a dependency on it.
To answer @Tibor17 ... I've updated https://github.com/jetty-project/junit-issue-801
There are 4 separate projects.
All 4 use the same version of maven-surefire-plugin
Project Name | Description | Behavior
-------------- | ----------- | ---------
junit5-forkcount-1 | Junit 5 provider, Using <forkCount>1</forkCount> | Crashes with org.apache.maven.plugin.PluginExecutionException :boom:
junit5-forkmode-always | Junit 5 provider, Using <forkMode>always</forkMode> | Crashes with org.apache.maven.plugin.PluginExecutionException :boom:
junit4-forkcount-1 | Junit 4 default, Using <forkCount>1</forkCount> | Terminates with org.apache.maven.plugin.MojoFailureException :heavy_check_mark:
junit4-forkmode-always | Junit 4 default, Using <forkMode>always</forkMode> | Terminates with org.apache.maven.plugin.MojoFailureException :heavy_check_mark:
So, there's 2 maven-surefire-plugin configurations that make the junit 5 surefire provider crash, but not the older junit 4 surefire provider ...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<forkMode>always</forkMode>
</configuration>
</plugin>
The problem in JUnit5 is this
The JUnit4 did not fail. It is src/main/java problem in main code of the
test project - similar to assertion error.
Remember that when you add a dependency to plugin it does not mean that
your provider is instantiated in plugin's ClassLoader. No, we load it in
isolated CL and the scope runtime does not cause the CL to inherit that one
class of logger means surefire-logger-api.
On Thu, Apr 12, 2018 at 7:38 PM, Joakim Erdfelt notifications@github.com
wrote:
To answer @Tibor17 https://github.com/Tibor17 ... I've updated
https://github.com/jetty-project/junit-issue-801There are 4 separate projects.
All 4 use the same version of maven-surefire-plugin
Project Name Description Behavior
junit5-forkcount-1 Junit 5 provider, Using1 Crashes
with org.apache.maven.plugin.PluginExecutionException ๐ฅ
junit5-forkmode-always Junit 5 provider, Usingalways Crashes
with org.apache.maven.plugin.PluginExecutionException ๐ฅ
junit4-forkcount-1 Junit 4 default, Using1 Terminates
with org.apache.maven.plugin.MojoFailureException โ๏ธ
junit4-forkmode-always Junit 4 default, Usingalways Terminates
with org.apache.maven.plugin.MojoFailureException โ๏ธSo, there's 2 maven-surefire-plugin configurations that make the junit 5
surefire provider crash, but not the older junit 4 surefire provider ...
Scenario 1: forkCount with reuseForks
org.apache.maven.plugins
maven-surefire-plugin
2.21.0
1
false
Scenario 1: forkMode = always
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.21.0</version> <configuration> <forkMode>always</forkMode> </configuration> </plugin>โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380886634,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRxfVjL4LS6fo7AJX1dbqw7gDLNzpks5tn5ElgaJpZM4NEluL
.
--
Cheers
Tibor
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>
You still do not understand.
On Thu, Apr 12, 2018 at 10:08 PM, Christian Stein notifications@github.com
wrote:
Tried to insert
test 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.ConsoleLoggerIndex: 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 @@
org.junit.platform
junit-platform-runner
${junit.platform.version} +test
org.junit.jupiter
junit-jupiter-engine
${junit.jupiter.version} +test
org.junit.jupiter
junit-jupiter-params
${junit.jupiter.version} +test
org.junit.vintage
junit-vintage-engine
${junit.vintage.version} +test
@@ -64,16 +68,6 @@
org.junit.platform
junit-platform-surefire-provider
${junit.platform.version} - -- -org.junit.jupiter -junit-jupiter-engine -${junit.jupiter.version} -- org.junit.vintage -junit-vintage-engine -${junit.vintage.version}
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 @@
org.junit.platform
junit-platform-runner
${junit.platform.version} +test
org.junit.jupiter
junit-jupiter-engine
${junit.jupiter.version} +test
org.junit.jupiter
junit-jupiter-params
${junit.jupiter.version} +test
org.junit.vintage
junit-vintage-engine
${junit.vintage.version} +test
@@ -65,16 +69,6 @@
org.junit.platform
junit-platform-surefire-provider
${junit.platform.version} - -- -org.junit.jupiter -junit-jupiter-engine -${junit.jupiter.version} -- org.junit.vintage -junit-vintage-engine -${junit.vintage.version}
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380928898,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRwAeoU6N_YSrOS2f8Zltwl8AYkMjks5tn7Q5gaJpZM4NEluL
.
--
Cheers
Tibor
Provider...
On Thu, Apr 12, 2018 at 10:12 PM, Tibor Digana tibor.digana@googlemail.com
wrote:
You still do not understand.
On Thu, Apr 12, 2018 at 10:08 PM, Christian Stein <
[email protected]> wrote:Tried to insert
test in both JUnit 5 samples and removed
the dependencies from the sure plugin configuration ... and they still fail
with ClassNotFoundException: org.apache.maven.plugin.surefi
re.log.api.ConsoleLoggerIndex: 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 @@
org.junit.platform
junit-platform-runner
${junit.platform.version} +test
org.junit.jupiter
junit-jupiter-engine
${junit.jupiter.version} +test
org.junit.jupiter
junit-jupiter-params
${junit.jupiter.version} +test
org.junit.vintage
junit-vintage-engine
${junit.vintage.version} +test
@@ -64,16 +68,6 @@
org.junit.platform
junit-platform-surefire-provider
${junit.platform.version} - -- -org.junit.jupiter -junit-jupiter-engine -${junit.jupiter.version} -- org.junit.vintage -junit-vintage-engine -${junit.vintage.version}
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 @@
org.junit.platform
junit-platform-runner
${junit.platform.version} +test
org.junit.jupiter
junit-jupiter-engine
${junit.jupiter.version} +test
org.junit.jupiter
junit-jupiter-params
${junit.jupiter.version} +test
org.junit.vintage
junit-vintage-engine
${junit.vintage.version} +test
@@ -65,16 +69,6 @@
org.junit.platform
junit-platform-surefire-provider
${junit.platform.version} - -- -org.junit.jupiter -junit-jupiter-engine -${junit.jupiter.version} -- org.junit.vintage -junit-vintage-engine -${junit.vintage.version}
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380928898,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRwAeoU6N_YSrOS2f8Zltwl8AYkMjks5tn7Q5gaJpZM4NEluL
.--
Cheers
Tibor
--
Cheers
Tibor
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?
test?surefire-logger-api dependency at ... test runtime. What ever the mode may be.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.
On Thu, Apr 12, 2018 at 10:43 PM, Christian Stein notifications@github.com
wrote:
Excerpt from junit-platform-surefire-provider-1.1.1.pom
http://central.maven.org/maven2/org/junit/platform/junit-platform-surefire-provider/1.1.1/junit-platform-surefire-provider-1.1.1.pom
:
org.junit.platform
junit-platform-surefire-provider
[...]
[...]
org.apache.maven.surefire
surefire-api
2.19.1
runtime
org.apache.maven.surefire
common-java5
2.19.1
runtime
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.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-380938257,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRyOmM1kwjw8mKsCkKt1ScoojJOVxks5tn7xrgaJpZM4NEluL
.
--
Cheers
Tibor
Please add further questions, findings and solutions regarding the _fork mode_ issue with the JUnit Platform Surefire Provider to #1367
Thanks.
Thanks, @Tibor17 and @sormuras!
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! ๐
I have applied all changes from Surefire's branch "junit5".
I will resolve conflicts with Jenkins CI (compiler versions), then I will
try to fix bugs after tests and then I will try to apply all changes
appeared after
https://github.com/junit-team/junit5/commit/2f49071dfc9005f556543e34ca41027c63fde927
and versions of new JUnit artifact versions.
On Fri, Apr 13, 2018 at 2:28 PM, Sam Brannen notifications@github.com
wrote:
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! ๐
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-381119906,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRyW5C6U8ykaeZG9sesxkC1YvkquQks5toJnvgaJpZM4NEluL
.
--
Cheers
Tibor
I will create a pull request on GitHub because this needs Benedikt to
support Surefire.
4 tests he added failed and I have no idea why.
So I have updated versions from 5.0.0-M3 to 5.1.1 and from 1.0.0-M3 to
1.1.1 and I got a new problem because you have compiled one artifact with
JDK9:
[INFO] Restricted to JDK 1.8 yet
org.junit.platform:junit-platform-commons:jar:1.1.1:compile contains
META-INF/versions/9/org/junit/platform/commons/util/ModuleUtils.class
targeted to 53.0
Tests in error:
testJunit16: JUnit
4.12.0-M2: Exit code was
non-zero: 1; command line and log = (..)
testJunit17: JUnit
5.0.0-M2: Exit code was
non-zero: 1; command line and log = (..)
test(org.apache.maven.surefire.its.JUnit5IT): Exit code was non-zero: 1;
command line and log = (..)
test40(org.apache.maven.surefire.its.JUnitPlattformIT): Exit code was
non-zero: 1; command line and log = (..)
Tests run: 759, Failures: 0, Errors: 4, Skipped: 138
[INFO] Running junitplattform.BasicTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
0.052 s <<< FAILURE! - in junitplattform.BasicTest
[ERROR] junitplattform.BasicTest.testSetUp() Time elapsed: 0.046 s <<<
FAILURE!
org.opentest4j.AssertionFailedError: setUp was not called
at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:48)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:48)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:43)
at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:119)
at junitplattform.BasicTest.testSetUp(BasicTest.java:55)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] junitplattform.BasicTest#testSetUp setUp was not called
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] BUILD FAILURE
On Fri, Apr 13, 2018 at 8:57 PM, Tibor Digana tibor.digana@googlemail.com
wrote:
I have applied all changes from Surefire's branch "junit5".
I will resolve conflicts with Jenkins CI (compiler versions), then I will
try to fix bugs after tests and then I will try to apply all changes
appeared after
https://github.com/junit-team/junit5/commit/2f49071dfc9005f556543e34ca4102
7c63fde927
and versions of new JUnit artifact versions.On Fri, Apr 13, 2018 at 2:28 PM, Sam Brannen notifications@github.com
wrote: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! ๐
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-381119906,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRyW5C6U8ykaeZG9sesxkC1YvkquQks5toJnvgaJpZM4NEluL
.--
Cheers
Tibor
--
Cheers
Tibor
Here is pull request to JUnit 5 in Surefire
https://github.com/apache/maven-surefire/pull/183
On Fri, Apr 13, 2018 at 11:47 PM, Tibor Digana tibor.digana@googlemail.com
wrote:
I will create a pull request on GitHub because this needs Benedikt to
support Surefire.
4 tests he added failed and I have no idea why.
So I have updated versions from 5.0.0-M3 to 5.1.1 and from 1.0.0-M3 to
1.1.1 and I got a new problem because you have compiled one artifact with
JDK9:[INFO] Restricted to JDK 1.8 yet org.junit.platform:junit-
platform-commons:jar:1.1.1:compile contains META-INF/versions/9/org/junit/
platform/commons/util/ModuleUtils.class targeted to 53.0Tests in error:
testJunit16: JUnit 4.12.0-M2: Exit code was non-zero: 1; command line
and log = (..)
testJunit17: JUnit 5.0.0-M2: Exit code was non-zero: 1; command line
and log = (..)
test(org.apache.maven.surefire.its.JUnit5IT): Exit code was non-zero:
1; command line and log = (..)
test40(org.apache.maven.surefire.its.JUnitPlattformIT): Exit code was
non-zero: 1; command line and log = (..)Tests run: 759, Failures: 0, Errors: 4, Skipped: 138
#
[INFO] Running junitplattform.BasicTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
0.052 s <<< FAILURE! - in junitplattform.BasicTest
[ERROR] junitplattform.BasicTest.testSetUp() Time elapsed: 0.046 s <<<
FAILURE!
org.opentest4j.AssertionFailedError: setUp was not called
at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:48)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:48)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:43)
at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:119)
at junitplattform.BasicTest.testSetUp(BasicTest.java:55)[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] junitplattform.BasicTest#testSetUp setUp was not called
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO][INFO] ------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------
On Fri, Apr 13, 2018 at 8:57 PM, Tibor Digana
[email protected] wrote:
I have applied all changes from Surefire's branch "junit5".
I will resolve conflicts with Jenkins CI (compiler versions), then I will
try to fix bugs after tests and then I will try to apply all changes
appeared after
https://github.com/junit-team/junit5/commit/2f49071dfc9005f5
56543e34ca41027c63fde927
and versions of new JUnit artifact versions.On Fri, Apr 13, 2018 at 2:28 PM, Sam Brannen notifications@github.com
wrote: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! ๐
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit5/issues/801#issuecomment-381119906,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_yRyW5C6U8ykaeZG9sesxkC1YvkquQks5toJnvgaJpZM4NEluL
.--
Cheers
Tibor--
Cheers
Tibor
--
Cheers
Tibor
Great, @Tibor17!
Thanks for taking the initiative!
Most helpful comment
@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.JUnitPlatformProviderwhich 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.javaSince 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.