You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tests: no integration test for DHT iterative FindValue lookup covering k-bucket split, stale-node pruning, and negative probe cache expiry #711
kind:testTest coverage, flakes, fixtures or the e2e harnessprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
PR #673 introduces iterative FindValue lookup and a negative probe cache, but there are no integration tests verifying the full lookup path including bucket splits when nodes depart, correct stale-node pruning from the routing table, and that negative cache entries expire after their TTL rather than poisoning future lookups.
This issue tracks missing integration test coverage for the DHT iterative FindValue lookup path introduced in PR #673. Three specific scenarios are called out: k-bucket split behavior on node departure, stale-node pruning from the routing table, and negative probe cache entry expiry. This is a well-scoped test gap with clear acceptance criteria derivable from ADR 022 and the existing implementation.
📊 Assessment
Dimension
Value
Reasoning
Type
Task
Test coverage work with a defined scope — no design decisions needed
Labels
testing, technical, rust, medium
Test-only task touching DHT/routing internals; medium priority since the production code ships but coverage is absent
Coding agent
Suitable
Three discrete test scenarios, clear behavioral contracts from ADR 022, existing primitives in crates/node/src/dht/ to build on
k-bucket split on node departure — spawn a multi-node in-process test network (iroh gossip can be run in-process with loopback transport), fill a bucket past k, then drop a node. Verify the routing table evicts the departed entry and that a subsequent FindValue for a hash in that bucket region still converges within the ADR 022 hop limits.
Stale-node pruning — simulate a node that becomes unreachable mid-lookup (drop its handler) and confirm the routing table marks it stale rather than leaving it as a live entry. Assert it's not re-queried within the same lookup pass.
Negative cache expiry — after a has_blob: false probe response for (NodeId, hash), assert that a re-probe within TTL is suppressed, then advance the clock past TTL and assert the entry is gone and the node would be re-queried. Use tokio::time::pause() / advance() for deterministic time control.
Suggested file:crates/node/tests/dht_integration.rs (or extend existing test modules in crates/node/src/dht/).
Key handles needed:
The negative probe cache handle (currently internal to the probe handler) may need to be exposed for test injection — worth checking if a #[cfg(test)] accessor already exists.
kind:testTest coverage, flakes, fixtures or the e2e harnessprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity
github-actions commentedon May 29, 2026
🎯 Triage report
This issue tracks missing integration test coverage for the DHT iterative FindValue lookup path introduced in PR #673. Three specific scenarios are called out: k-bucket split behavior on node departure, stale-node pruning from the routing table, and negative probe cache entry expiry. This is a well-scoped test gap with clear acceptance criteria derivable from ADR 022 and the existing implementation.
📊 Assessment
testing,technical,rust,mediumcrates/node/src/dht/to build on🔗 Similar issues
💡 Notes and suggestions
Three test scenarios to implement:
k-bucket split on node departure — spawn a multi-node in-process test network (iroh gossip can be run in-process with loopback transport), fill a bucket past
k, then drop a node. Verify the routing table evicts the departed entry and that a subsequent FindValue for a hash in that bucket region still converges within the ADR 022 hop limits.Stale-node pruning — simulate a node that becomes unreachable mid-lookup (drop its handler) and confirm the routing table marks it stale rather than leaving it as a live entry. Assert it's not re-queried within the same lookup pass.
Negative cache expiry — after a
has_blob: falseprobe response for(NodeId, hash), assert that a re-probe within TTL is suppressed, then advance the clock past TTL and assert the entry is gone and the node would be re-queried. Usetokio::time::pause()/advance()for deterministic time control.Suggested file:
crates/node/tests/dht_integration.rs(or extend existing test modules incrates/node/src/dht/).Key handles needed:
#[cfg(test)]accessor already exists.References:
adr/022-content-discovery.md§FIND_VALUE Flow, §Lookup integrity, §Negative probe cachecrates/node/src/dht/lookup.rs(landed via PR feat(node): iterative FindValue lookup + negative probe cache (PR 5/5 of #320) #673)adr/001-*for negative probe cache TTL specAdd this agentic workflows to your repo
To install this agentic workflow, run
test(node): integration tests for DHT FindValue lookup (closes #711) (#…