test(desktop-backend): bypass proxies for loopback tests#9725
Conversation
|
This is an internal test-harness-only change, so it intentionally has no user-facing changelog fragment. Please add the |
|
Nice, well-scoped fix. The One note on CI: the context shows a cancelled by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Reviewed — looks good; not auto-merging (over scope/size or non-bug area), landing left to maintainer.
kodjima33
left a comment
There was a problem hiding this comment.
test(desktop-backend): bypass proxies for loopback tests; CI green
kodjima33
left a comment
There was a problem hiding this comment.
test(desktop-backend): bypass proxies for loopback tests; CI green
What changed and why
Closes #9722.
Use a shared test-only reqwest client with system proxies disabled for the four proxy cancellation tests backed by an in-process loopback listener. This keeps production proxy behavior unchanged while making the tests deterministic on Windows hosts with a user proxy enabled.
Product invariants affected
none
How it was verified
Verified on Windows 11 with the user proxy still enabled at
127.0.0.1:7897:502and the loopback listener never saw the request.cargo test routes::proxy::tests::-> 87 passedcargo test-> 360 passedcargo fmt --check-> passedcargo clippy -- -D warnings-> passedscripts/pre-push fork-> passed all selected checks withPYTHONUTF8=1and the internal-only changelog skipThe actual push used
--no-verifyonly after the equivalent pre-push command passed because the single-flight hook wrapper currently crashes on Windows; #9724 tracks that separate issue.Tests
The four existing loopback cancellation tests are the regression coverage. They fail on the old code when a Windows system proxy is enabled and pass with the test client isolated from host proxy settings.
Root cause and durable guard (bug fixes)
The violated contract was that an in-process loopback test server must receive the test request directly.
reqwest::Client::new()honors the Windows user proxy, and that proxy can intercept127.0.0.1requests before they reach the test listener.All four affected tests now obtain their client from one
local_test_client()helper that calls.no_proxy(). The production Gemini clients are untouched, and future loopback cancellation coverage in this module has a single portable client factory to reuse.