Periodic NullPointerExceptions in HeartBeatEvent running `gradle test` in OS X

I've been trying to resolve an issue in an Elasticsearch plugin I maintain. This plugin builds fine for others in Ubuntu, but a fresh build in OS X is producing pretty inscrutable test failures.

To see if it was me, I brought down Elasticsearch source and ran gradle test and indeed I've gotten the same errors, listed at the bottom. Only a couple of tests are failing, most pass. But some randomly fail.

Is this something known on OS X? Is there a workaround? Searching hasn't turned up anything (but my google-fu may be weak)

Exception thrown by subscriber method onHeartbeat(com.carrotsearch.ant.tasks.junit4.events.aggregated.HeartBeatEvent) on subscriber com.carrotsearch.gradle.junit4.TestReportLogger@52ca2fa9 when dispatching event: com.carrotsearch.ant.tasks.junit4.events.aggregated.HeartBeatEvent@3fa57c62
java.lang.NullPointerException
        at com.carrotsearch.ant.tasks.junit4.ForkedJvmInfo.getPidString(ForkedJvmInfo.java:85)
        at com.carrotsearch.ant.tasks.junit4.ForkedJvmInfo$getPidString.call(Unknown Source)
        at com.carrotsearch.gradle.junit4.TestReportLogger.onHeartbeat(TestReportLogger.groovy:116)
        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 com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:95)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:154)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$1.run(Subscriber.java:80)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:76)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:119)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:215)
        at com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.slowHeartBeat(AggregatingListener.java:76)
        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 com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:95)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:154)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$1.run(Subscriber.java:80)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:76)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:119)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:215)
        at com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$3.run(LocalSlaveStreamHandler.java:149)

Build Hamster Info:

=======================================
Elasticsearch Build Hamster says Hello!
=======================================
  Gradle Version        : 4.0
  OS Info               : Mac OS X 10.12.5 (x86_64)
  JDK Version           : Oracle Corporation 1.8.0_131 [Java HotSpot(TM) 64-Bit Server VM 25.131-b11]
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0

Seen building Elasticsearch trunk and 5.4.0

In case anyone comes across this in the future, I think this is a randomized testing issue with a log statement that's actually not a big deal. See here

Also the fact that the build failed was unrelated to this stack trace. It failed because I had ES_HEAP_SIZE set in my environment from a project that uses ES 2.x. Elasticsearch integration tests (or something in the build pipeline) detects this is set and issues a failure.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.