apache / apache/pulsar

Flaky-test: org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest.allSchemasShouldSupportNull and allSchemasShouldRoundtripInput

Open
#11,037 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 22h
Merged PRs (30d)
142

Description

```
java.lang.NullPointerException: NPE when using schema null : null
at org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest.allSchemasShouldRoundtripInput(PrimitiveSchemaTest.java:132)
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)
```

output:

> Starting test [TestClass name=class org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest].allSchemasShouldRoundtripInput([{null=[00:18:23.823175, 22:18:23.823181], org.apache.pulsar.client.impl.schema.ByteSchema@2b4829aa=[-1, 0], org.apache.pulsar.client.impl.schema.DateSchema@32d22650=[2021-06-23, 2021-06-23], org.apache.pulsar.client.impl.schema.LocalDateSchema@33a71d23=[2021-06-23, 2021-06-21], org.apache.pulsar.client.impl.schema.BytesSchema@2fa879ed=[[B@9880a15], org.apache.pulsar.client.impl.schema.ShortSchema@794d28a3=[32767, -32768], org.apache.pulsar.client.impl.schema.TimestampSchema@4f6fd101=[2021-06-23 00:18:13.82, 2021-06-23 00:18:23.82], org.apache.pulsar.client.impl.schema.DoubleSchema@a99c42c=[5678567.12312, -5678567.12341], org.apache.pulsar.client.impl.schema.ByteBufferSchema@2b2b7e3c=[java.nio.HeapByteBuffer[pos=9 lim=10 cap=10]], org.apache.pulsar.client.impl.schema.StringSchema@aee05f4=[my string], org.apache.pulsar.client.impl.schema.TimeSchema@135064ea=[00:18:13, 00:18:23], org.apache.pulsar.client.impl.schema.InstantSchema@106459d9=[2021-06-23T00:18:23.820925Z, 2021-06-22T23:55:23.820928Z], org.apache.pulsar.client.impl.schema.FloatSchema@1a01ffff=[5678567.0, -5678567.0], org.apache.pulsar.client.impl.schema.BooleanSchema@2bcb1414=[false, true], org.apache.pulsar.client.impl.schema.IntSchema@a55e82a=[423412424, -41243432], org.apache.pulsar.client.impl.schema.LongSchema@70ee9d31=[922337203685477580, -922337203685477581], org.apache.pulsar.client.impl.schema.LocalDateTimeSchema@12166229=[2021-06-23T00:18:23.823191, 2021-06-21T00:18:23.823199, 2021-04-14T00:18:23.823209]}])-------
> 00:18:23.964 [TestNG-method=allSchemasShouldRoundtripInput-1:org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest@122] INFO org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest - Test schema null
> 00:18:23.964 [TestNG-method=allSchemasShouldRoundtripInput-1:org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest@124] INFO org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest - Encode : 00:18:23.823175

Contributor guide

Open the contributing guide

Research direction

Start with org.apache.pulsar.client.impl.schema.PrimitiveSchemaTest and run allSchemasShouldSupportNull and allSchemasShouldRoundtripInput, focusing on the failure at line 132. Reproduce the null-schema NPE and compare the test output for the two cases. Done means both tests pass reliably without the reported flaky failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.