From df9346fefbde0a2b10f21d6c0a0b2c9c4b890bc2 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Tue, 17 Jan 2023 12:58:01 +0100 Subject: [PATCH] node: Fix E2E tests The tests were flaky because the routes are sampled at a moment when gossip could still be happening. Instead, we check the local inventory directly to build the expected routing table. Signed-off-by: Alexis Sellier --- radicle-node/src/tests/e2e.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radicle-node/src/tests/e2e.rs b/radicle-node/src/tests/e2e.rs index 04399419..6d51eb6b 100644 --- a/radicle-node/src/tests/e2e.rs +++ b/radicle-node/src/tests/e2e.rs @@ -10,7 +10,7 @@ use radicle::git::refname; use radicle::identity::Id; use radicle::node::Handle; use radicle::profile::Home; -use radicle::storage::WriteStorage; +use radicle::storage::{ReadStorage, WriteStorage}; use radicle::test::fixtures; use radicle::Storage; use radicle::{assert_matches, rad}; @@ -126,10 +126,10 @@ fn check<'a>(nodes: impl IntoIterator) -> BTreeSet<(Id, NodeId) // First build the set of all routes. for node in &nodes { - let routing = node.handle.routing().unwrap(); + let inv = node.storage.inventory().unwrap(); - for (rid, seed) in routing.try_iter() { - all_routes.insert((rid, seed)); + for rid in inv { + all_routes.insert((rid, node.id)); } }