test: re-seed test_get_retry_with_alternatives_sparse_topology for current stdlib#4451
Conversation
…rrent stdlib (#3506) ## Problem `test_get_retry_with_alternatives_sparse_topology` has been `#[ignore]`d since PR #3488. Its hardcoded seed (`0xBEEF_CAFE_0001`) no longer produces the intended sparse-but-reachable topology under the current freenet-stdlib: the stdlib's enum layout changes bincode serialization sizes, which perturbs the seeded RNG stream and shifts topology formation. Under the current stdlib that seed leaves one GET requester (node-6 today, originally node-10/node-3) unable to reach any contract-caching node within HTL=2, so the test's all-nodes-reachable assertion fails. The ignored test provides zero coverage of the GET retry-with-alternatives path in a sparse topology. ## Solution Re-seed the test for the current stdlib layout and remove `#[ignore]`. The new seed `0x3506_000B_0001` was found by an empirical search over the same topology parameters (10 nodes, HTL=2, max_connections=6) and verified to satisfy both constraints the test depends on: - Sparse: a PUT-only run of this exact topology caches the contract at exactly 2 of the 10 nodes (nodes 4 and 5), matching the issue's "2-3 caching nodes" premise. - Reachable + deterministic: all 10 GET requesters reach a caching node, so the 8 non-cacher requesters exercise the retry-with-alternatives / k_closest re-query path. Confirmed 10/10 across repeated runs. The GET retry logic itself is unchanged; this is purely a seed/topology repair, so no production code is touched. ## Testing `cargo nextest run -p freenet --features "simulation_tests,testing" --test simulation_integration -E 'test(test_get_retry_with_alternatives_sparse_topology)'` now passes deterministically (the test is no longer ignored). Sparseness was verified out-of-band with a PUT-only variant of the same network (PUT caches at 2/10 nodes), and the full test was run multiple times with the chosen seed to confirm 10/10 reachability every time. Closes #3506 [AI-assisted - Claude]
Rule Review: No issues foundRules checked: No rule violations detected. The change is a clean, well-scoped test maintenance PR: it removes an Rule review against |
Multi-model review (consolidated)Risk tier: routing/topology is normally a Full-tier surface, but this change is test-only (a single External model pass — Codex (
|
Problem
test_get_retry_with_alternatives_sparse_topology(incrates/core/tests/simulation_integration.rs) has been#[ignore]d sincePR #3488. Its hardcoded seed (
0xBEEF_CAFE_0001) no longer produces theintended sparse-but-reachable topology under the current
freenet-stdlib:the stdlib's enum layout changes bincode serialization sizes, which perturbs
the seeded RNG stream and shifts topology formation. Under the current stdlib
that seed leaves one GET requester (node-6 today; the issue originally observed
node-10/node-3) unable to reach any contract-caching node within HTL=2, so the
test's all-nodes-reachable assertion fails. While ignored, the test provides
zero coverage of the GET retry-with-alternatives path in a sparse topology.
Solution
Re-seed the test for the current stdlib layout and remove
#[ignore]. The newseed
0x3506_000B_0001was found by an empirical search over the test's owntopology parameters (10 nodes, HTL=2, max_connections=6) and verified to
satisfy both constraints the test depends on:
exactly 2 of the 10 nodes (nodes 4 and 5), matching the issue's "2-3
caching nodes" premise. So 8 of the 10 GET requesters genuinely have to use
the retry-with-alternatives / k_closest re-query path.
confirmed 10/10 across repeated runs. Live logs show the expected
get: attempt timed out; advancingretry events firing for the distantrequesters.
The GET retry logic itself is unchanged. This is purely a seed/topology repair
in a single test function; no production code is touched.
Note: like every seed-coupled topology test, a future stdlib/topology change
could perturb the RNG stream again and require another re-seed. That is the
expected maintenance for these tests, not a regression in the retry logic
(which is also covered by
test_get_routing_coverage_low_htl).Testing
now passes (the test is no longer ignored). Sparseness was verified
out-of-band with a temporary PUT-only variant of the same network (PUT caches
at 2/10 nodes), and the full test was run multiple times with the chosen seed
to confirm 10/10 reachability every time. The temporary instrumentation used
for the seed search is not part of this diff.
Closes #3506
[AI-assisted - Claude]