Skip to content

JerseyRouterTestSuite.AsyncContextTest were affected by context propagation improvements #3384

@idelpivnitskiy

Description

@idelpivnitskiy

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 bodyAsyncContextAssertionFilter 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions