apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.14k stars 3.57k forks source link

[test] NPE of StringSchema for branch-2.10 #16000

Open codelipenghui opened 2 years ago

codelipenghui commented 2 years ago

Describe the bug https://github.com/apache/pulsar/runs/6812506434?check_suite_focus=true

Error:  Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 7.561 s <<< FAILURE! - in org.apache.pulsar.broker.service.BrokerServiceBundlesCacheInvalidationTest
Error:  testRecreateNamespace(org.apache.pulsar.broker.service.BrokerServiceBundlesCacheInvalidationTest)  Time elapsed: 0.2 s  <<< FAILURE!
java.lang.NullPointerException
    at java.base/java.lang.String.getBytes(String.java:963)
    at org.apache.pulsar.client.impl.schema.StringSchema.encode(StringSchema.java:98)
    at org.apache.pulsar.client.impl.schema.StringSchema.encode(StringSchema.java:34)
    at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.value(TypedMessageBuilderImpl.java:173)
    at org.apache.pulsar.client.impl.ProducerBase.send(ProducerBase.java:62)
    at org.apache.pulsar.broker.service.BrokerServiceBundlesCacheInvalidationTest.testRecreateNamespace(BrokerServiceBundlesCacheInvalidationTest.java:57)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
    at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
    at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
    at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

To Reproduce Always fail on CI but it's not able to reproduce on my laptop

codelipenghui commented 2 years ago

Looks like temurin has a new release jdk-11.0.15+10 which introduced the issue. After rollback to [jdk-11.0.14+101], the failed test gets passed.

https://github.com/apache/pulsar/runs/6826520926?check_suite_focus=true

eolivelli commented 2 years ago

@codelipenghui @nicoloboschi is there any link to a OpenJDK issue ? I can create tickets on OpenJDK JIRA, if it is a new issue we can report it but we need more context

codelipenghui commented 2 years ago

Sorry @eolivelli

I'm still testing. It's not a JDK issue but related to reuseFork. I have disabled the reuseFork in PR #15995, the test gets passed. Looks like the reuseFork lead some static code doesn't work.

The test was just very flaky. After change to jdk-11.0.14+101, the test just passed, but just lucky.

github-actions[bot] commented 2 years ago

The issue had no activity for 30 days, mark with Stale label.