Skip to content

Commit

Permalink
unsuccessfull attempt at making tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed Jan 12, 2024
1 parent 812432a commit c43c2d4
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions chitchat/tests/cluster_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,15 @@ async fn test_marked_for_deletion_gc_with_network_partition() {
predicate: NodeStatePredicate::MarkedForDeletion("key_a".to_string(), false),
timeout_opt: None,
},
// Wait for garbage collection: grace period * heartbeat ~ 1 second + margin of 1 second.
Operation::Wait(Duration::from_secs(2)),
// Add node 4 which communicates only with node 3.
Operation::RemoveNetworkLink(chitchat_id_1.clone(), chitchat_id_4.clone()),
Operation::RemoveNetworkLink(chitchat_id_2.clone(), chitchat_id_4.clone()),
Operation::AddNode {
chitchat_id: chitchat_id_4.clone(),
peer_seeds: Some(vec![chitchat_id_3.clone()]),
},
// Wait for garbage collection: grace period * heartbeat ~ 1 second + margin of 1 heartbeat.
Operation::Wait(Duration::from_millis(1100)),
Operation::NodeStateAssert {
server_chitchat_id: chitchat_id_2.clone(),
chitchat_id: chitchat_id_1.clone(),
Expand All @@ -402,16 +409,7 @@ async fn test_marked_for_deletion_gc_with_network_partition() {
predicate: NodeStatePredicate::KeyPresent("key_a".to_string(), false),
timeout_opt: None,
},
// Add node 4 which communicates only with node 3.
Operation::RemoveNetworkLink(chitchat_id_1.clone(), chitchat_id_4.clone()),
Operation::RemoveNetworkLink(chitchat_id_2.clone(), chitchat_id_4.clone()),
Operation::AddNode {
chitchat_id: chitchat_id_4.clone(),
peer_seeds: Some(vec![chitchat_id_3.clone()]),
},
// Wait for propagation
// We need to wait longer... because node 4 is just starting?
Operation::Wait(Duration::from_millis(500)),
// node 3 and 4 don't know about the deletion, but node 4 learned of key_a through node 3
Operation::NodeStateAssert {
server_chitchat_id: chitchat_id_3.clone(),
chitchat_id: chitchat_id_1.clone(),
Expand All @@ -424,9 +422,15 @@ async fn test_marked_for_deletion_gc_with_network_partition() {
predicate: NodeStatePredicate::KeyPresent("key_a".to_string(), true),
timeout_opt: None,
},
// Relink node 3
// Relink node 3 to 1 and 2
Operation::AddNetworkLink(chitchat_id_1.clone(), chitchat_id_3.clone()),
Operation::AddNetworkLink(chitchat_id_1.clone(), chitchat_id_2.clone()),
Operation::AddNetworkLink(chitchat_id_2.clone(), chitchat_id_3.clone()),
// TODO test break here. It seems node 3 receive news from node 1 that the max_version is a
// missmatch. It asks why, and node 1 unhelfully reply nothing (it no longer has a
// tombstone for the item node 3 knows about)
// it's unclear why it worked before.
// (other changes to these tests were made because node 3 would end up thinking node 1 was
// dead, and not transmit its informations to node 4)
Operation::NodeStateAssert {
server_chitchat_id: chitchat_id_3.clone(),
chitchat_id: chitchat_id_1.clone(),
Expand Down

0 comments on commit c43c2d4

Please sign in to comment.