Skip to content

Commit

Permalink
add edge2
Browse files Browse the repository at this point in the history
  • Loading branch information
sehz committed Oct 31, 2024
1 parent b0e3b62 commit 4131f5e
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions crates/fluvio-spu/src/mirroring/test/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ async fn test_mirror_home_to_edge() {
let home_port = local_port();

let home_builder = ReplicaConfig::builder()
// .remote_clusters(vec![edg1.to_owned(), "edge2".to_owned()])
.remote_clusters(vec![EDGE1.to_owned()])
.remote_clusters(vec![EDGE1.to_owned(), EDGE2.to_owned()])
.home_to_remote(true)
.generate("mirror_home");
let home_gctx = home_builder.init_mirror_home().await;
Expand Down Expand Up @@ -224,13 +223,12 @@ async fn test_mirror_home_to_edge() {
assert_eq!(home_replica0.leo(), 0);

// check 2nd home replica
/*

let home_replica1 = home_gctx
.leaders_state()
.get(&ReplicaKey::new("temp", 1u32))
.get(&ReplicaKey::new(default_topic(), 1u32))
.await
.expect("2nd targert");
*/

// start home server
debug!("starting home server");
Expand Down Expand Up @@ -289,11 +287,11 @@ async fn test_mirror_home_to_edge() {
// home should have recods
assert_eq!(remote_replica_1.leo(), 2);

/*
// start 2nd remote
let sourcd_builder2 = ReplicaConfig::builder()
.home_port(home_port.clone())
.home_cluster("edge2".to_owned())
.remote_cluster(EDGE2)
.home_to_remote(true)
.generate("mirror_remote");

let (_remote_ctx2, remote_replica2) = sourcd_builder2.init_mirror_remote().await;
Expand All @@ -305,10 +303,11 @@ async fn test_mirror_home_to_edge() {
assert_eq!(
remote_mirror2.remote().expect("remote"),
&RemotePartitionConfig {
home_spu_key: "temp-0".to_owned(),
home_cluster: "edge2".to_owned(),
home_spu_key: default_replica().to_owned(),
home_cluster: default_home_cluster().to_owned(),
home_spu_id: 5001,
home_spu_endpoint: home_port.clone(),
target: true
}
);

Expand All @@ -317,20 +316,17 @@ async fn test_mirror_home_to_edge() {
sleep(Duration::from_secs(1)).await;
debug!("done waiting");

remote_replica2
.write_record_set(
&mut create_raw_recordset(2),
remote_ctx1.follower_notifier(),
)
// write records from home
home_replica1
.write_record_set(&mut create_raw_recordset(2), home_gctx.follower_notifier())
.await
.expect("write");

assert_eq!(remote_replica2.leo(), 2);
assert_eq!(home_replica1.leo(), 2);

debug!("waiting for mirroring");
sleep(Duration::from_secs(5)).await;
debug!("done waiting");
// home should have recods
assert_eq!(home_replica1.leo(), 2);
*/
}

0 comments on commit 4131f5e

Please sign in to comment.