maven-surefire
maven-surefire copied to clipboard
[SUREFIRE-1629] Added integration test for surefire-1629
The interesting bit is if you remove module1, module2 from the testcase (convert it to a single-module project) then Surefire returns the compiler error to the console without crashing. The presence of modules causes it to crash for some reason.
I am waiting for our build process to complete. Then i will cherry pick your last three commits and i will execute it localy. Let's see what will happen afterwards...
@cowwoc
I have the result after running the test on our fix in #293 .
The problem is that your package is named java
. You should not create such of folder module2/src/test/java/java/testcase
and create e.g. module2/src/test/java/testcase
.
This is the error found in the dump:
Error occurred during initialization of boot layer
java.lang.LayerInstantiationException: Class loader (instance of):
'app' tried to define prohibited package name: java.testcase
@Tibor17 This is intentional. I am expecting to get the same error message in forked-mode as in non-forked mode. Meaning, Surefire should not crash/dump. It should output the compiler error as it does in non-forked mode.
It is a little complicated.
So, the latest commit in master is able to print the message Error occurred during initialization of boot layer
.
Normally the plugin is using the process pipes however you wont see these problems with tcp/ip channel used by the forked process. The only issue why this channel is not enabled by default is the reason that we introduced it in current version and the master branch and we want to prevent from using it by 100% of users. It's better to let it used by little percentage and fix some issues however we do not expect any. We will enable the tcp/ip channel in the last milestone version. This is how you can enable the tcp/ip:
<configuration>
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
</configuration>
@Tibor17 Sounds good. Can you please make the integration test pass with this configuration and leave a note to remove it when the implementation becomes default?
@cowwoc
We have several integration tests which are using <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
. For instance see the tests in ConsoleOutputIT
. Truly it is hard to simulate native calls with standard output, for instance JVM and GC of JPMS uses native calls in order to print the JVM warning (regarding JVM warnings Error occurred during initialization of boot layer
) on the standard output and error. One way would be java.io.FileDescriptor.out
obviosly refers to the native calls, but I do not use to show it in the public audience. If you would try to use native calls in new integration test, then it would confirm the fix with <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
.