-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
MockWebServer - simulate lower-level DNS/connection/TLS/HTTP Protocol issues #8555
Comments
I'd suggest something like mockserver for this. OkHttp MockWebServer is not being actively enhanced. |
Was hoping part of this would be for OkHttp to improve testability/quality, whether that be with MockWebServer or otherwise. |
Do you have a concrete example of one of these tests? It's potentially something we would add as tests, but unlikely to provide new public API in MockWebServer. There are already better more complete mock servers out there. For DNS, this is already possible by providing a custom Dns to the client. For http2 frames, this is already possible internally with some examples tests. |
A few examples:
|
Are you looking to get unblocked to add some tests? Or is this just a request for the maintainers to add more tests for issues you've been negatively affected by? |
A combination of built-in testing for issues we've been negatively affected by and a general desire to "make OkHttp better" where possible/practical. |
Sounds good. for internal project use, if there are things that you might want to add to MockWebServer, then it sounds reasonable. I think we'd just avoid new public API. |
There's classes of failures below the "HTTP message" level that are hard to unit-test; this would help improve the robustness of the OkHttp client and software that builds on it (e.g. frameworks, SDKs).
Proposal: model the lower-level components in MockWebServer such that their behaviour can be adjusted.
Key areas:
A rough sampling of related issues that may be easier to prevent / diagnose with enhanced testability:
Connection issues
* awslabs/aws-sdk-kotlin#1214
HTTP (/2) protocol violations
* #8524
* #8408
* #7913
* #7840
* #3955
DNS failures
* #8481
The text was updated successfully, but these errors were encountered: