JerseyRouterTestSuite.AsyncContextTest were affected by context propagation improvements
- Dominant language
- Java
- Stars
- 1k
- Forks
- 229
- Avg merge
- 23h 23m
- Merged PRs (30d)
- 16
Description
In #3170 we accidentally disabled all `JerseyRouterTestSuite` and restored them back in #3383. However, due to improvements we made in #3218 and #3221 assertions inside `JerseyRouterTestSuite.AsyncContextTest` trigger errors.
For JAX-RS endpoints that do not have payload body`AsyncContextAssertionFilter` expects that keys are not set during request payload draining. Those assertions worked correctly because we were relying on old buggy behavior when context was not propagated correctly through all parts of request-response chain. Now that the context propagates as expected, we see keys when `DrainingStreamingHttpServiceFilter` auto-drains the request body after executing the endpoint.
To make behavior correct, we need to explicitly drain request payload when we find the route and see that it does not have incoming payload body. We should also throw an exception if draining detects some incoming bytes.
Contributor guide
Research direction
Start with JerseyRouterTestSuite.AsyncContextTest and inspect AsyncContextAssertionFilter and DrainingStreamingHttpServiceFilter, along with the context propagation changes referenced in #3218 and #3221. Confirm the route-handling path for endpoints without a payload body; done means the request is explicitly drained and incoming bytes cause an exception while the affected assertions pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100