aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/layout/test.rs
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2024-03-04 19:58:32 +0100
committerYureka <yuka@yuka.dev>2024-03-07 12:45:33 +0100
commitc1769bbe69f723fb3980cf4fdac7615cfb782720 (patch)
treee623904bbdc861b42039057d6a1e982486fc60b4 /src/rpc/layout/test.rs
parent8f86af52ed917bce506989ae1f378d977aa6c3ef (diff)
downloadgarage-c1769bbe69f723fb3980cf4fdac7615cfb782720.tar.gz
garage-c1769bbe69f723fb3980cf4fdac7615cfb782720.zip
ReplicationMode -> ConsistencyMode+ReplicationFactor
Diffstat (limited to 'src/rpc/layout/test.rs')
-rw-r--r--src/rpc/layout/test.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/layout/test.rs b/src/rpc/layout/test.rs
index 88eb518e..fcbb9dfc 100644
--- a/src/rpc/layout/test.rs
+++ b/src/rpc/layout/test.rs
@@ -5,6 +5,7 @@ use garage_util::crdt::Crdt;
use garage_util::error::*;
use crate::layout::*;
+use crate::replication_mode::ReplicationFactor;
// This function checks that the partition size S computed is at least better than the
// one given by a very naive algorithm. To do so, we try to run the naive algorithm
@@ -120,7 +121,7 @@ fn test_assignment() {
let mut node_capacity_vec = vec![4000, 1000, 2000];
let mut node_zone_vec = vec!["A", "B", "C"];
- let mut cl = LayoutHistory::new(3);
+ let mut cl = LayoutHistory::new(ReplicationFactor::new(3).unwrap());
update_layout(&mut cl, &node_capacity_vec, &node_zone_vec, 3);
let v = cl.current().version;
let (mut cl, msg) = cl.apply_staged_changes(Some(v + 1)).unwrap();