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

Ungraceful continuous testing failure in dev mode due to (unhandled?) Jackson serialization error when communicating with dev ui #35653

Closed
alexkolson opened this issue Aug 31, 2023 · 7 comments · Fixed by #35670
Assignees
Labels
area/continuous-testing area/dev-ui area/devmode area/jackson Issues related to Jackson (JSON library) env/windows Impacts Windows machines kind/bug Something isn't working triage/needs-feedback We are waiting for feedback.
Milestone

Comments

@alexkolson
Copy link

alexkolson commented Aug 31, 2023

Describe the bug

When running tests in development mode (quarkus dev or mvn quarkus:dev), if an exception is thrown as part of a test that cannot be serialized to json for the dev UI, then continuous testing fails with a jackson processing exception and you have to restart the quarkus dev process.

If you run your tests with quarkus:test then everything is fine, as there is no attempt to parse the test results as json.

I think that any sort of error / exception that occurs in the dev-ui/as part of the dev-ui communication should not interfere with continuous testing at all. These errors (IMO) should be stopped before they bleed into the continuous processing experience, as when they do, this interrupts development flow using quarkus dev.

Expected behavior

An error occurring in the communication process for the dev-ui should not cause the continuous testing process to fail, requiring a restart.

Actual behavior

An error occurring in the communication process for the dev-ui causes the continuous testing process to fail, requiring a restart.

How to Reproduce?

  1. Download the reproducer
  2. Run mvn quarkus:test
  3. See a nicely reported test failure like so:
2023-08-31 10:45:24,901 ERROR [io.qua.test] (Test runner thread) ==================== TEST REPORT #1 ==================== [Error Occurred After Shutdown]
2023-08-31 10:45:24,901 ERROR [io.qua.test] (Test runner thread) Test AwesomeServiceTest#watch it burn() failed
 [Error Occurred After Shutdown]: org.jboss.resteasy.reactive.ClientWebApplicationException: Received: 'Not Found, status code 404' when invoking: Rest Client method: 'de.awesomecompany.awesomeproduct.awesomeness.AwesomeRestClient#activateMaximumCoolness'
        at org.jboss.resteasy.reactive.client.impl.RestClientRequestContext.unwrapException(RestClientRequestContext.java:185)
        at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.handleException(AbstractResteasyReactiveContext.java:322)
        at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:173)
        at org.jboss.resteasy.reactive.client.impl.RestClientRequestContext$1.lambda$execute$0(RestClientRequestContext.java:295)
        at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
        at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:246)
        at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:43)
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: jakarta.ws.rs.WebApplicationException: Not Found, status code 404
        at io.quarkus.rest.client.reactive.runtime.DefaultMicroprofileRestClientExceptionMapper.toThrowable(DefaultMicroprofileRestClientExceptionMapper.java:18)
        at io.quarkus.rest.client.reactive.runtime.MicroProfileRestClientResponseFilter.filter(MicroProfileRestClientResponseFilter.java:52)
        at org.jboss.resteasy.reactive.client.handlers.ClientResponseFilterRestHandler.handle(ClientResponseFilterRestHandler.java:21)
        at org.jboss.resteasy.reactive.client.handlers.ClientResponseFilterRestHandler.handle(ClientResponseFilterRestHandler.java:10)
        at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.invokeHandler(AbstractResteasyReactiveContext.java:229)
        at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
        ... 12 more
  1. Stop quarkus:test
  2. Start quarkus:dev
  3. Press 'r' to start continuous testing process
  4. See a jackson serialization error like so
2023-08-31 10:49:15,226 ERROR [io.qua.test] (Test runner thread) Internal error running tests: java.lang.RuntimeException: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: io.quarkus.deployment.dev.testing.TestRunResults["results"]->java.util.Collections$UnmodifiableMap["AwesomeServiceTest"]->io.quarkus.deployment.dev.testing.TestClassResult["failing"]->java.util.ArrayList[0]->io.quarkus.deployment.dev.testing.TestResult["problems"]->java.util.Collections$UnmodifiableRandomAccessList[0]->org.jboss.resteasy.reactive.ClientWebApplicationException["cause"]->jakarta.ws.rs.WebApplicationException["response"]->org.jboss.resteasy.reactive.client.impl.ClientResponseImpl["entityStream"])
        at io.quarkus.devui.runtime.continuoustesting.ContinuousTestingJsonRPCService.invokeAction(ContinuousTestingJsonRPCService.java:96)
        at io.quarkus.devui.runtime.continuoustesting.ContinuousTestingJsonRPCService.getResults(ContinuousTestingJsonRPCService.java:89)
        at io.quarkus.devui.runtime.continuoustesting.ContinuousTestingJsonRPCService.accept(ContinuousTestingJsonRPCService.java:39)
        at io.quarkus.devui.runtime.continuoustesting.ContinuousTestingJsonRPCService.accept(ContinuousTestingJsonRPCService.java:15)
        at io.quarkus.devui.runtime.continuoustesting.ContinuousTestingJsonRPCService_ClientProxy.accept(Unknown Source)
        at io.quarkus.dev.testing.ContinuousTestingSharedStateManager.setLastState(ContinuousTestingSharedStateManager.java:36)
        at io.quarkus.deployment.dev.testing.ContinuousTestingSharedStateListener$1.runComplete(ContinuousTestingSharedStateListener.java:53)
        at io.quarkus.deployment.dev.testing.TestSupport.runInternal(TestSupport.java:475)
        at io.quarkus.deployment.dev.testing.TestSupport$3.run(TestSupport.java:381)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: io.quarkus.deployment.dev.testing.TestRunResults["results"]->java.util.Collections$UnmodifiableMap["AwesomeServiceTest"]->io.quarkus.deployment.dev.testing.TestClassResult["failing"]->java.util.ArrayList[0]->io.quarkus.deployment.dev.testing.TestResult["problems"]->java.util.Collections$UnmodifiableRandomAccessList[0]->org.jboss.resteasy.reactive.ClientWebApplicationException["cause"]->jakarta.ws.rs.WebApplicationException["response"]->org.jboss.resteasy.reactive.client.impl.ClientResponseImpl["entityStream"])
        at io.quarkus.devui.deployment.menu.ContinuousTestingProcessor.lambda$registerGetResultsMethod$5(ContinuousTestingProcessor.java:198)
        at io.quarkus.devui.runtime.continuoustesting.ContinuousTestingJsonRPCService.invokeAction(ContinuousTestingJsonRPCService.java:94)
        ... 9 more
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: io.quarkus.deployment.dev.testing.TestRunResults["results"]->java.util.Collections$UnmodifiableMap["AwesomeServiceTest"]->io.quarkus.deployment.dev.testing.TestClassResult["failing"]->java.util.ArrayList[0]->io.quarkus.deployment.dev.testing.TestResult["problems"]->java.util.Collections$UnmodifiableRandomAccessList[0]->org.jboss.resteasy.reactive.ClientWebApplicationException["cause"]->jakarta.ws.rs.WebApplicationException["response"]->org.jboss.resteasy.reactive.client.impl.ClientResponseImpl["entityStream"])
        at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
        at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1306)
        at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:408)
        at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:53)
        at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:733)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:733)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:733)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
        at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
        at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:733)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
        at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
        at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:733)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:808)
        at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:764)
        at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720)
        at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:733)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
        at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4624)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3852)
        at io.quarkus.devui.deployment.menu.ContinuousTestingProcessor.lambda$registerGetResultsMethod$5(ContinuousTestingProcessor.java:193)
        ... 11 more

Output of uname -a or ver

Microsoft Windows [Version 10.0.19045.3393]

Output of java -version

openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

GraalVM version (if different from Java)

N/A

Quarkus version or git rev

3.0.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c) Maven home: C:\Users\olson\dev\tools\apache-maven-3.9.2 Java version: 17.0.5, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.5.8-hotspot Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

N/A

@alexkolson alexkolson added the kind/bug Something isn't working label Aug 31, 2023
@quarkus-bot quarkus-bot bot added area/continuous-testing area/dev-ui area/devmode area/jackson Issues related to Jackson (JSON library) env/windows Impacts Windows machines labels Aug 31, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 31, 2023

/cc @cescoffier (devui), @geoand (jackson), @gsmet (jackson), @phillip-kruger (devui), @stuartwdouglas (continuous-testing)

@geoand
Copy link
Contributor

geoand commented Aug 31, 2023

I see you are using 3.0.3.Final. Have you tried with 3.2.5.Final or 3.3.1?

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Aug 31, 2023
@alexkolson
Copy link
Author

Hi @geoand thanks for the quick response and for all of your awesome work on quarkus! I have not, and this is a good suggestion. I will try this! Just out of curiosity, do you know that something in this area specifically changed between 3.0.3.Final and 3.2.5.Final or 3.3.1?

@geoand
Copy link
Contributor

geoand commented Aug 31, 2023

I know that we have fixed a lot of bugs, so maybe this has also been fixed 😎

@alexkolson
Copy link
Author

@geoand Just tried with 3.3.1 and see the same behavior.

@geoand
Copy link
Contributor

geoand commented Aug 31, 2023

Thanks for checking

@phillip-kruger
Copy link
Member

I'll have a look, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/continuous-testing area/dev-ui area/devmode area/jackson Issues related to Jackson (JSON library) env/windows Impacts Windows machines kind/bug Something isn't working triage/needs-feedback We are waiting for feedback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants