Skip to content

Fix: stop the ping rewrite test from querying real DNS - #494

Merged
SandObserver merged 1 commit into
mainfrom
fix/ping-rewrite-test-dns
Oct 18, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/ping-rewrite-test-dns

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Replace the dns.lookup fake in proxy-ping-rewrite.test.js with fakes of dns.promises.Resolver.prototype.resolve4/resolve6 and dns.promises.lookup, the calls api/src/resolve.js makes.
  • The test no longer sends queries to the system DNS server, and no longer times out after 4 s when that server is slow.

Testing
All green. With a DNS server that never answers, the file takes 45 ms instead of stalling for 4 s.

Changelog

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.

The test faked dns.lookup only. Host names now resolve through
dns.promises.Resolver and dns.promises.lookup, so the test queried the
real DNS server and failed when it answered slowly.
@SandObserver SandObserver added the bug Something isn't working label Oct 18, 2026
@SandObserver
SandObserver merged commit ca38c75 into main Oct 18, 2026
6 checks passed
@SandObserver
SandObserver deleted the fix/ping-rewrite-test-dns branch October 18, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant