Repository navigation
test(node): route dht_lookup teardown through the bounded support::shutdown helper (#1831) - #1846
Merged
Merged
Conversation
… six-server teardown The comment above `mod support;` justified fully-qualified `support::shutdown` calls by a competing `TestServer::shutdown` method, which this file no longer has. Import the helper instead, as `dht_loopback.rs` and `probe_loopback.rs` do, and keep only the part of the comment that holds: teardown goes through the bounded helper rather than a bare `Endpoint::close().await`. The six-server ceiling test now carries its length in the type. `servers` becomes a `[TestServer; 6]` at construction, so teardown destructures `servers.map(TestServer::into_teardown_parts)` into the two arrays `shutdown` wants instead of rebuilding them through two `Vec` conversions whose error arms cannot fire. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Coverage reportTotal: 82.09% (was 82.08%, ● 0.00%) — 68890/83925 lines No coverage data for changed Rust files. History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1831.
Mirrors what #1830 did for
dht_integration.rs:crates/node/tests/dht_lookup.rsno longer hand-rolls teardown.mod support;+use support::shutdown;, asdht_loopback.rsandprobe_loopback.rsdo. Nothing in this file shadows the name:TestServer::shutdownis gone.JoinHandle<()>(drop the decorativeanyhow::Result), soshutdownreturns a panicking server task'sJoinErrorrather than discarding it via.abort().TestServer::shutdown(fire-and-forgettokio::spawnclose) withinto_teardown_parts(self) -> (JoinHandle<()>, Endpoint).shutdowncall, client endpoint first — one deadline per test rather than one per endpoint.serversis a[TestServer; 6], so teardown destructuresservers.map(TestServer::into_teardown_parts)into the two arraysshutdownwants.Verified:
cargo fmt -- --checkandcargo clippy -p decdn-node --all-targets -- -D warningsclean;dht_lookup,dht_integration, anddht_loopbacksuites all pass (28/28).