mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
fetcher/state: Extend test for same RID, different nodes
The extension of the test shows that Node B's fetch cannot be dequeued because the RID is in the active fetch set. It can then be dequeued once Node A has been fetched from.
This commit is contained in:
@@ -101,6 +101,17 @@ fn fetch_same_repo_different_nodes_queues_second() {
|
||||
let active = state.get_active_fetch(&repo_1);
|
||||
assert!(active.is_some());
|
||||
assert_eq!(*active.unwrap().from(), node_a);
|
||||
|
||||
// Cannot dequeue for node_b since the repo is active
|
||||
assert!(state.dequeue(&node_b).is_none());
|
||||
|
||||
// Clearing the orphaned entry (as a fix, or a restart, would) unblocks it.
|
||||
state.fetched(command::Fetched {
|
||||
from: node_a,
|
||||
rid: repo_1,
|
||||
});
|
||||
let dequeued = state.dequeue(&node_b).expect("repo is fetchable again");
|
||||
assert_eq!(dequeued.rid, repo_1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user