Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
7.27.0.Final
-
None
-
NEW
-
NEW
Description
When compilation tests failing Surefire logs are not clear.
For example when ConcurrentBuildTest fails with Surefire error message:
Regression org.kie.workbench.common.services.backend.compiler.ConcurrentBuildTest.buildFourProjectsInFourThread Failing for the past 1 build (Since Unstable#648 ) Took 1 min 37 sec. Error Message expected:<[tru]e> but was:<[fals]e> Stacktrace org.junit.ComparisonFailure: expected:<[tru]e> but was:<[fals]e> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at org.kie.workbench.common.services.backend.compiler.ConcurrentBuildTest.buildFourProjectsInFourThread(ConcurrentBuildTest.java:107) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
The root cause is actually network issues, but you can find it only on some fs reports, not in surefire report:
2019-09-23 22:46:43,458 [f6c1bd04-a372-4fdd-a72c-304efe279430] ERROR o.k.w.c.s.b.c.i.e.ReusableAFMavenCli - Failed to execute goal io.takari.maven.plugins:takari-lifecycle-plugin:1.13.9:compile (default-compile) on project kie-maven-plugin-test-kjar-2: Execution default-compile of goal io.takari.maven.plugins:takari-lifecycle-plugin:1.13.9:compile failed: Plugin io.takari.maven.plugins:takari-lifecycle-plugin:1.13.9 or one of its dependencies could not be resolved: Could not transfer artifact org.eclipse.jdt:org.eclipse.jdt.core:jar:3.14.0 from/to central (https://repo.maven.apache.org/maven2): Invalid Content-Range header for partial download from offset 1022862: bytes 290188-6836331/6836332 -> [Help 1] 2019-09-23 22:46:43,458 [f6c1bd04-a372-4fdd-a72c-304efe279430] ERROR o.k.w.c.s.b.c.i.e.ReusableAFMavenCli -
The solution can be update asserts with maven info like this for unstable line:
assertThat(result.get().isSuccessful()).isTrue().withFailMessage("Test failed during compilation with maven output:", result.get().getMavenOutput().toArray());