jkleinsc

#55409: test: make configureHostResolver spec hermetic

Merged
Created: Oct 27, 2026, 5:50:09 PM
Merged: Oct 28, 2026, 8:37:43 AM
5 comments
Target: main

Requested by John Kleinschmidt · Slack thread

Description of Change

The app module > configureHostResolver > affects dns lookup behavior spec sent a real HEAD request to https://www.electronjs.org to show that name resolution worked before switching to a dead DoH server. That is external egress from CI and depends on the network being up.

The spec now starts a small local DoH server (RFC 8484 POST, answering every A query with 127.0.0.1 and any other query type with an empty NOERROR response, not NXDOMAIN, because an NXDOMAIN answer to Chromium's www.gstatic.com DoH probe trips a DCHECK in the network service) and a local HTTP server. It points configureHostResolver at the local DoH server and expects the request to succeed, then switches to the dead DoH address and expects a different hostname to fail with ERR_NAME_NOT_RESOLVED. The coverage is the same, and the spec now also proves that the configured resolver is actually used. The DoH server uses the fixture certificate, so the spec trusts it with setCertificateVerifyProc on the default session and resets that afterwards.

I checked the same logic in a standalone app on the v47.0.0-nightly.20261027 Linux x64 build: step 1 got a 200 through the local DoH server, step 3 failed with ERR_NAME_NOT_RESOLVED, and without the verify proc the DoH handshake is rejected as expected.

Checklist

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vf2yMt934Tt5KncFWXpm2G

Release Notes

Notes: none


Generated by Claude Code

Backports

43-x-y
In-flight
PR Number
#55422
Waiting to be merged
44-x-y
Merged
PR Number
#55420
Merged At
Oct 28, 2026, 6:16:47 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#55423
Merged At
Oct 28, 2026, 6:16:56 PM
Released In
Not yet
Release Date
Not yet
46-x-y
Merged
PR Number
#55421
Merged At
Oct 28, 2026, 6:16:51 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron