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

Enhance connection: close tests to cover more use-cases on the server-side #1100

Merged
merged 3 commits into from
Jul 23, 2020

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

Current tests for handling of connection: close header focused on the client
side, missing some of the interesting server-side use-cases when request or
response payload is delayed.

Modifications:

  • Summarize all tests related to connection: close header in one class:
    ConnectionCloseHeaderHandlingTest;
  • Share secure proxy tunnel related code between ConnectionCloseHeaderHandlingTest
    and HttpsProxyTest;
  • Parametrize tests in ConnectionCloseHeaderHandlingTest to cover all
    combinations of request-response ordering;

Result:

Enhanced test coverage for connection: close handling logic.

…er-side

Motivation:

Current tests for handling of `connection: close` header focused on the client
side, missing some of the interesting server-side use-cases when request or
response payload is delayed.

Modifications:

- Summarize all tests related to `connection: close` header in one class:
`ConnectionCloseHeaderHandlingTest`;
- Share secure proxy tunnel related code between `ConnectionCloseHeaderHandlingTest`
and `HttpsProxyTest`;
- Parametrize tests in `ConnectionCloseHeaderHandlingTest` to cover all
combinations of request-response ordering;

Result:

Enhanced test coverage for `connection: close` handling logic.
import static java.util.concurrent.Executors.newCachedThreadPool;
import static java.util.concurrent.TimeUnit.MILLISECONDS;

final class ProxyTunnel implements AutoCloseable {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is moved from HttpsProxyTest without any changes.

@idelpivnitskiy idelpivnitskiy merged commit a742c54 into apple:master Jul 23, 2020
@idelpivnitskiy idelpivnitskiy deleted the server-half-close branch July 23, 2020 21:49
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

Successfully merging this pull request may close these issues.

2 participants