Skip to content

chore: add TCP handler and warmup tests#11

Merged
PhantomInTheWire merged 1 commit intomasterfrom
test/tcp-warmup
Feb 25, 2026
Merged

chore: add TCP handler and warmup tests#11
PhantomInTheWire merged 1 commit intomasterfrom
test/tcp-warmup

Conversation

@PhantomInTheWire
Copy link
Copy Markdown
Owner

@PhantomInTheWire PhantomInTheWire commented Feb 25, 2026

Summary by CodeRabbit

  • Tests
    • Added test coverage for resolver warmup logic, including root server queries and delegation cache population.
    • Added comprehensive test suite for TCP DNS handler, covering basic queries, error handling, message validation, and query counting.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a720fd7 and 261b5ad.

📒 Files selected for processing (2)
  • internal/resolver/warmup_test.go
  • internal/server/tcp_test.go

📝 Walkthrough

Walkthrough

Two new test files are introduced: one for resolver warmup logic featuring a mockTransport struct to simulate DNS queries, and another for TCP DNS handler with a mockResolver to test various query scenarios and error conditions.

Changes

Cohort / File(s) Summary
Resolver Warmup Tests
internal/resolver/warmup_test.go
Adds mockTransport struct implementing the Transport interface to simulate DNS queries. Includes three tests validating RTT probing of root servers, delegation cache population, and context cancellation behavior.
TCP Handler Tests
internal/server/tcp_test.go
Adds mockResolver struct for testing and helper utilities (writeTCPQuery, readTCPResponse, makeTestQuery, makeTestResponse). Includes five tests covering basic queries, resolver errors, invalid message sizes, pipelined queries, and query counting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through test files bright,
Mock transports and resolvers take flight!
TCP streams and warmup flows,
Coverage grows as the test suite glows!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/tcp-warmup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PhantomInTheWire PhantomInTheWire merged commit 13ca890 into master Feb 25, 2026
5 of 6 checks passed
@PhantomInTheWire PhantomInTheWire deleted the test/tcp-warmup branch February 25, 2026 20:17
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.

1 participant