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

Remove stacktraces from exceptions thrown deliberately in RESTEasy Reactive tests #19579

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Aug 23, 2021

This is done so developers looking at the output of tests will not be tricked
by false negatives

@geoand geoand requested a review from gsmet August 23, 2021 12:02
@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 23, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 23, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 5736e48

Status Name Step Test failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
✔️ JVM Tests - JDK 16

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 Windows #

📦 extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment

io.quarkus.resteasy.reactive.server.test.resteasy.async.filters.AsyncRequestFilterTest.testRequestFilters line 118 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <200> but was: <500>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:510)
	at io.quarkus.resteasy.reactive.server.test.resteasy.async.filters.AsyncRequestFilterTest.testRequestFilters(AsyncRequestFilterTest.java:118)
	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 io.quarkus.test.QuarkusUnitTest.runExtensionMethod(Quarku...

…active tests

This is done so developers looking at the output of tests will not be tricked
by false negatives
@geoand geoand force-pushed the rr-tests-exceptions branch from 5736e48 to 4dc12b9 Compare August 23, 2021 12:46
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 23, 2021

Failing Jobs - Building 4dc12b9

Status Name Step Test failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
✔️ JVM Tests - JDK 16

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 Windows #

📦 extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment

io.quarkus.resteasy.reactive.server.test.resteasy.async.filters.AsyncRequestFilterTest.testRequestFilters line 119 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <200> but was: <500>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:510)
	at io.quarkus.resteasy.reactive.server.test.resteasy.async.filters.AsyncRequestFilterTest.testRequestFilters(AsyncRequestFilterTest.java:119)
	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 io.quarkus.test.QuarkusUnitTest.runExtensionMethod(Quarku...

@geoand
Copy link
Contributor Author

geoand commented Aug 23, 2021

@stuartwdouglas this seems very suspicious:

2021-08-23T13:11:46.2712615Z [INFO] Running io.quarkus.resteasy.reactive.server.test.resteasy.async.filters.AsyncRequestFilterTest
2021-08-23T13:11:48.6329913Z 2021-08-23 13:11:48,616 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT on JVM started in 0.870s. Listening on: http://localhost:8081
2021-08-23T13:11:48.6331988Z 2021-08-23 13:11:48,617 INFO  [io.quarkus] (main) Profile test activated. 
2021-08-23T13:11:48.6333532Z 2021-08-23 13:11:48,617 INFO  [io.quarkus] (main) Installed features: [cdi, hibernate-validator, jaxrs-client-reactive, resteasy-reactive, security, smallrye-context-propagation]
2021-08-23T13:11:51.4201818Z 2021-08-23 13:11:51,395 INFO  [io.ver.ext.web.RoutingContext] (executor-thread-1) RoutingContext failure (500): java.lang.RuntimeException: Cannot be called when outside a handler chain
2021-08-23T13:11:51.4214347Z 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.requireCDIRequestScope(AbstractResteasyReactiveContext.java:220)
2021-08-23T13:11:51.4219228Z 	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:38)
2021-08-23T13:11:51.4223247Z 	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:8)
2021-08-23T13:11:51.4227127Z 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
2021-08-23T13:11:51.4229999Z 	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:548)
2021-08-23T13:11:51.4231986Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2021-08-23T13:11:51.4233954Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2021-08-23T13:11:51.4235636Z 	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
2021-08-23T13:11:51.4237673Z 	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
2021-08-23T13:11:51.4240166Z 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2021-08-23T13:11:51.4241682Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2021-08-23T13:11:51.4242111Z 
2021-08-23T13:11:51.4243834Z 2021-08-23 13:11:51,396 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to / failed, error id: e3f90ad0-3ce8-4759-866b-7262b85702cd-1: java.lang.RuntimeException: Cannot be called when outside a handler chain
2021-08-23T13:11:51.4247579Z 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.requireCDIRequestScope(AbstractResteasyReactiveContext.java:220)
2021-08-23T13:11:51.4252342Z 	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:38)
2021-08-23T13:11:51.4256563Z 	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:8)
2021-08-23T13:11:51.4260702Z 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
2021-08-23T13:11:51.4263658Z 	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:548)
2021-08-23T13:11:51.4265700Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2021-08-23T13:11:51.4267450Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2021-08-23T13:11:51.4269269Z 	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
2021-08-23T13:11:51.4271268Z 	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
2021-08-23T13:11:51.4273533Z 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2021-08-23T13:11:51.4275004Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2021-08-23T13:11:51.4275479Z 
2021-08-23T13:11:51.4284534Z 2021-08-23 13:11:51,399 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (executor-thread-1) Request failed: java.lang.RuntimeException: Cannot be called when outside a handler chain
2021-08-23T13:11:51.4288815Z 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.requireCDIRequestScope(AbstractResteasyReactiveContext.java:220)
2021-08-23T13:11:51.4293481Z 	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:38)
2021-08-23T13:11:51.4297528Z 	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:8)
2021-08-23T13:11:51.4301701Z 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
2021-08-23T13:11:51.4304788Z 	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:548)
2021-08-23T13:11:51.4306711Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2021-08-23T13:11:51.4308516Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2021-08-23T13:11:51.4310238Z 	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
2021-08-23T13:11:51.4312262Z 	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
2021-08-23T13:11:51.4314584Z 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2021-08-23T13:11:51.4316059Z 	at java.base/java.lang.Thread.run(Thread.java:829)

Perhaps it has to do with the latest changed made to the run method?

@gsmet gsmet merged commit ad4ab5e into quarkusio:main Aug 23, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 23, 2021
@quarkus-bot quarkus-bot bot added this to the 2.3 - main milestone Aug 23, 2021
@geoand geoand deleted the rr-tests-exceptions branch August 23, 2021 13:29
@stuartwdouglas
Copy link
Member

I was going to take a more general approach to fixing this with the filtering approach I outlined in the quarkus-dev post.

In addition this does not seem to actually work, locally I see:

Caused by: java.lang.ClassNotFoundException: io.quarkus.resteasy.reactive.server.test.ExceptionUtil

The test is expected to fail, so it still passes, but this is something that would be picked up by the more general logging approach.

@gsmet
Copy link
Member

gsmet commented Aug 24, 2021

I will backport it as all the future tests will be a pain.

@gsmet
Copy link
Member

gsmet commented Aug 24, 2021

Hum, I just saw @stuartwdouglas 's message. I'll fix the test instead.

@geoand
Copy link
Contributor Author

geoand commented Aug 24, 2021

I think Stuart already fixed it in another PR

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

Successfully merging this pull request may close these issues.

3 participants