Sentry-java: Fresh clone failed make with test failure: TestNG60Configurator Exception in thread "Thread-2" java.lang.NullPointerException

Created on 23 Aug 2019  路  4Comments  路  Source: getsentry/sentry-java

SHA: 8aa5a918dc05380c0fd747d45f977a2de6590d27

% java -version                                                                                                                                                                                   
openjdk version "1.8.0_202-release"
OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
OpenJDK 64-Bit Server VM (build 25.202-b49-5587405, mixed mode)

% mvn -version                                                                                                                                                                                    
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T08:00:29+13:00)
Maven home: /usr/local/Cellar/maven/3.6.1/libexec
Java version: 1.8.0_202-release, vendor: JetBrains s.r.o, runtime: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre
Default locale: en_NZ, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"

$make
gives me the error:

[INFO] Running TestSuite
Configuring TestNG with: TestNG60Configurator
Exception in thread "Thread-2" java.lang.NullPointerException
    at io.sentry.servlet.SentryServletRequestListenerTest$5.run(SentryServletRequestListenerTest.java:87)
Configuring TestNG with: TestNG60Configurator
[ERROR] Tests run: 279, Failures: 6, Errors: 0, Skipped: 0, Time elapsed: 9.623 s <<< FAILURE! - in TestSuite
[ERROR] testEventExtraWrittenProperly(io.sentry.marshaller.json.JsonMarshallerTest)  Time elapsed: 0.01 s  <<< FAILURE!
java.lang.NullPointerException
    at io.sentry.marshaller.json.JsonMarshallerTest.testEventExtraWrittenProperly(JsonMarshallerTest.java:381)

[ERROR] serializedEventContainsSerializableExtras(io.sentry.event.EventTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.NullPointerException
    at io.sentry.event.EventTest.serializedEventContainsSerializableExtras(EventTest.java:44)

[ERROR] (io.sentry.event.EventBuilderHostnameCacheTest)  Time elapsed: 0.001 s  <<< FAILURE!
java.lang.IllegalArgumentException: argument type mismatch

[ERROR] (io.sentry.event.EventBuilderHostnameCacheTest)  Time elapsed: 0.001 s  <<< FAILURE!
java.lang.IllegalArgumentException: argument type mismatch

[ERROR] testDsnLookupWithEmptyEnvironmentVariable(io.sentry.dsn.DsnTest)  Time elapsed: 0.001 s  <<< FAILURE!
java.lang.IllegalArgumentException: argument type mismatch

[ERROR] testDsnLookupWithEnvironmentVariable(io.sentry.dsn.DsnTest)  Time elapsed: 0 s  <<< FAILURE!
java.lang.IllegalArgumentException: argument type mismatch

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   DsnTest.testDsnLookupWithEmptyEnvironmentVariable 禄 IllegalArgument argument t...
[ERROR]   DsnTest.testDsnLookupWithEnvironmentVariable 禄 IllegalArgument argument type m...
[ERROR] io.sentry.event.EventBuilderHostnameCacheTest.(io.sentry.event.EventBuilderHostnameCacheTest)
[ERROR]   Run 1: EventBuilderHostnameCacheTest.successfulHostnameRetrievalIsCachedForFiveHours 禄 IllegalArgument
[ERROR]   Run 2: EventBuilderHostnameCacheTest.unsuccessfulHostnameRetrievalIsCachedForOneSecond 禄 IllegalArgument
[INFO]   Run 3: PASS
[INFO]
[ERROR]   EventTest.serializedEventContainsSerializableExtras:44 禄 NullPointer
[ERROR] io.sentry.marshaller.json.JsonMarshallerTest.testEventExtraWrittenProperly(io.sentry.marshaller.json.JsonMarshallerTest)
[ERROR]   Run 1: JsonMarshallerTest.testEventExtraWrittenProperly:381 禄 NullPointer
[INFO]   Run 2: PASS
[INFO]   Run 3: PASS
[INFO]   Run 4: PASS
[INFO]   Run 5: PASS
[INFO]   Run 6: PASS
[INFO]   Run 7: PASS
[INFO]   Run 8: PASS
[INFO]   Run 9: PASS
[INFO]   Run 10: PASS
[INFO]   Run 11: PASS
[INFO]   Run 12: PASS
[INFO]
[INFO]
[ERROR] Tests run: 266, Failures: 5, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Sentry-Java 1.7.28-SNAPSHOT:
[INFO]
[INFO] Sentry-Java ........................................ SUCCESS [  0.754 s]
[INFO] Sentry-Java client ................................. FAILURE [ 12.052 s]
[INFO] Sentry-Java for Android ............................ SKIPPED
[INFO] Sentry-Java for Google AppEngine ................... SKIPPED
[INFO] Sentry-Java for log4j .............................. SKIPPED
[INFO] Sentry-Java for Logback ............................ SKIPPED
[INFO] Sentry-Java for log4j2 ............................. SKIPPED
[INFO] Sentry-Java for Spring ............................. SKIPPED
[INFO] sentry-spring-boot-starter ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.049 s
[INFO] Finished at: 2019-08-23T11:49:26+12:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project sentry: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/zhengfang.zang/workspace/sentry-java/sentry/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project sentry: There are test failures.

Please refer to /Users/zhengfang.zang/workspace/sentry-java/sentry/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /Users/zhengfang.zang/workspace/sentry-java/sentry/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
    at org.apache.maven.plugin.surefire.SurefireHelper.throwException (SurefireHelper.java:289)
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution (SurefireHelper.java:161)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary (SurefirePlugin.java:364)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked (AbstractSurefireMojo.java:1041)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute (AbstractSurefireMojo.java:857)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sentry
Java 1.8 issue

Most helpful comment

Btw. 1.8.0_222 can now be used for building as well. No failures on master any more.

All 4 comments

@fangzhzh, the testsuite seems to be quite picky about the java version used for the tests. I'm in the process of simplifying the tests and moving away from JMockit and TestNG in hopes that that will improve the situation (https://github.com/getsentry/sentry-java/pull/759). Especially JMockit does some very hardcore things to support constructor mocking and system class mocking which I assume might be the problem here...

I'm using java 1.8.0_191 with success and the CI on Travis is using 1.8.0_121. I tried using 1.8.0_222 and I get failures as well.

It's related to #478

We've removed TestNG from the project. Hopefully no issues now.

Btw. 1.8.0_222 can now be used for building as well. No failures on master any more.

Was this page helpful?
0 / 5 - 0 ratings