-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
It appears that Testnet::new(n) actually spins up n + 1 nodes.
Consider this test
#[tokio::test]
async fn single_key_republish_insufficient() {
let dht = pkarr::mainline::Testnet::new(3).unwrap();
let mut pkarr_builder = pkarr::ClientBuilder::default();
pkarr_builder.bootstrap(&dht.bootstrap).no_relays();
let pkarr_client = pkarr_builder.clone().build().unwrap();
let public_keys = publish_sample_packets(&pkarr_client, 1).await;
let public_key = public_keys.first().unwrap().clone();
let mut settings = RepublisherSettings::default();
settings
.pkarr_client(pkarr_client)
.min_sufficient_node_publish_count(NonZeroU8::new(4).unwrap());
let publisher = MultiRepublisher::new_with_settings(settings, Some(pkarr_builder));
let results = publisher.run_serially(public_keys).await.unwrap();
let result = results.get(&public_key).unwrap();
assert!(result.is_err());
}This test used to work before pkarr and mainline were upgraded in #315 .
There are two ways this test can be made to work:
- by using
Testnet::new_unseeded(3)in the first line, to instantiate thedht - by bumping the argument of
min_sufficient_node_publish_countto5- since the test expects an
err, the fact a5here succeeds and4fails hints at the fact that the test published to4nodes
- since the test expects an
Both suggest that Testnet::new(n), which internally uses Testnet::build_seeded, actually spins up 4 nodes.
Please investigate and re-align the behavior of Testnet::new(n) with Testnet::new_unseeded(n) in terms of created nodes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels