[PR #2741] [MERGED] Use async test attribute macros #3275

Closed
opened 2026-03-16 11:34:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2741
Author: @divergentdave
Created: 1/25/2025
Status: Merged
Merged: 1/26/2025
Merged by: @divergentdave

Base: mainHead: david/tokio-test-macro


📝 Commits (2)

  • 04113bc Use async test attribute macros
  • 130e46d Fix ignored www.example.com test

📊 Changes

21 files changed (+874 additions, -1023 deletions)

View changed files

📝 crates/async-std-resolver/src/tests.rs (+76 -129)
📝 crates/proto/src/h2/h2_client_stream.rs (+53 -46)
📝 crates/proto/src/h3/h3_client_stream.rs (+46 -46)
📝 crates/proto/src/multicast/mdns_stream.rs (+3 -4)
📝 crates/proto/src/tcp/tcp_client_stream.rs (+7 -14)
📝 crates/proto/src/tcp/tcp_stream.rs (+7 -14)
📝 crates/proto/src/tests/tcp.rs (+15 -27)
📝 crates/proto/src/tests/udp.rs (+6 -13)
📝 crates/proto/src/udp/udp_client_stream.rs (+6 -13)
📝 crates/proto/src/udp/udp_stream.rs (+13 -20)
📝 crates/resolver/src/h2.rs (+13 -14)
📝 crates/resolver/src/h3.rs (+10 -12)
📝 crates/resolver/src/name_server/name_server.rs (+25 -36)
📝 crates/resolver/src/name_server/name_server_pool.rs (+14 -17)
📝 crates/resolver/src/quic.rs (+10 -12)
📝 crates/resolver/src/resolver.rs (+178 -222)
📝 crates/resolver/src/tls.rs (+10 -13)
📝 crates/server/src/server/server_future.rs (+11 -14)
📝 tests/integration-tests/tests/integration/client_future_tests.rs (+271 -243)
📝 tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs (+55 -54)

...and 1 more files

📄 Description

This changes most unit tests that currently manually construct Tokio/async-std runtimes to instead use attribute macros, making the whole test function async. I skipped some trickier tests, i.e. ignored tests that are currently failing, or tests that explicitly check functionality across two async runtime instances.

I also added subscribe(); to the top of some tests, and fixed another www.example.com issue in an ignored test.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/2741 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 1/25/2025 **Status:** ✅ Merged **Merged:** 1/26/2025 **Merged by:** [@divergentdave](https://github.com/divergentdave) **Base:** `main` ← **Head:** `david/tokio-test-macro` --- ### 📝 Commits (2) - [`04113bc`](https://github.com/hickory-dns/hickory-dns/commit/04113bc33f82b2de9c35bbd77b34ed0f47498f32) Use async test attribute macros - [`130e46d`](https://github.com/hickory-dns/hickory-dns/commit/130e46d18252fc481193a9af683a474a40847468) Fix ignored www.example.com test ### 📊 Changes **21 files changed** (+874 additions, -1023 deletions) <details> <summary>View changed files</summary> 📝 `crates/async-std-resolver/src/tests.rs` (+76 -129) 📝 `crates/proto/src/h2/h2_client_stream.rs` (+53 -46) 📝 `crates/proto/src/h3/h3_client_stream.rs` (+46 -46) 📝 `crates/proto/src/multicast/mdns_stream.rs` (+3 -4) 📝 `crates/proto/src/tcp/tcp_client_stream.rs` (+7 -14) 📝 `crates/proto/src/tcp/tcp_stream.rs` (+7 -14) 📝 `crates/proto/src/tests/tcp.rs` (+15 -27) 📝 `crates/proto/src/tests/udp.rs` (+6 -13) 📝 `crates/proto/src/udp/udp_client_stream.rs` (+6 -13) 📝 `crates/proto/src/udp/udp_stream.rs` (+13 -20) 📝 `crates/resolver/src/h2.rs` (+13 -14) 📝 `crates/resolver/src/h3.rs` (+10 -12) 📝 `crates/resolver/src/name_server/name_server.rs` (+25 -36) 📝 `crates/resolver/src/name_server/name_server_pool.rs` (+14 -17) 📝 `crates/resolver/src/quic.rs` (+10 -12) 📝 `crates/resolver/src/resolver.rs` (+178 -222) 📝 `crates/resolver/src/tls.rs` (+10 -13) 📝 `crates/server/src/server/server_future.rs` (+11 -14) 📝 `tests/integration-tests/tests/integration/client_future_tests.rs` (+271 -243) 📝 `tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs` (+55 -54) _...and 1 more files_ </details> ### 📄 Description This changes most unit tests that currently manually construct Tokio/async-std runtimes to instead use attribute macros, making the whole test function async. I skipped some trickier tests, i.e. ignored tests that are currently failing, or tests that explicitly check functionality across two async runtime instances. I also added `subscribe();` to the top of some tests, and fixed another `www.example.com` issue in an ignored test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:34:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3275
No description provided.