Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException in GrpcExceptionHandlerSpec #184

Open
He-Pin opened this issue Oct 12, 2023 · 3 comments
Open

java.lang.NullPointerException in GrpcExceptionHandlerSpec #184

He-Pin opened this issue Oct 12, 2023 · 3 comments

Comments

@He-Pin
Copy link
Member

He-Pin commented Oct 12, 2023

[ERROR] [10/12/2023 15:08:18.179] [pool-9-thread-9-ScalaTest-running-GrpcExceptionHandlerSpec] [org.apache.pekko.grpc.scaladsl.GrpcExceptionHandler(pekko://Test)] Unhandled error: [null]rpcClientSettingsSpec 0s
java.lang.NullPointerException
        at org.apache.pekko.grpc.scaladsl.GrpcExceptionHandlerSpec.<init>(GrpcExceptionHandlerSpec.scala:53)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:454)
        at sbt.TestRunner.runTest$1(TestFramework.scala:153)
        at sbt.TestRunner.run(TestFramework.scala:168)
        at sbt.TestFramework$$anon$3$$anonfun$$lessinit$greater$1.$anonfun$apply$1(TestFramework.scala:336)
        at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:296)
        at sbt.TestFramework$$anon$3$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:336)
        at sbt.TestFramework$$anon$3$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:336)
        at sbt.TestFunction.apply(TestFramework.scala:348)
        at sbt.Tests$.$anonfun$toTask$1(Tests.scala:436)
        at sbt.std.Transform$$anon$3.$anonfun$apply$2(Transform.scala:47)
        at sbt.std.Transform$$anon$4.work(Transform.scala:69)
        at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
        at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
        at sbt.Execute.work(Execute.scala:292)
        at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
        at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

@raboof
Copy link
Member

raboof commented Oct 12, 2023

The test succeeds, and I think it's generally intentional that this exception is logged.

Instead of sending it to the console when running the test, though, we should probably capture the log output and verify as part of the test that it is found in there.

@laglangyue
Copy link
Contributor

image

GrpcExceptionHandlerSpec test exception assertion will record an error log to the console.

Do we have a way to temporarily set Log off ? @raboof @He-Pin
So we can separate test for NullPointerException and RuntimeException, and set Log off

@raboof
Copy link
Member

raboof commented Apr 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants