From 49ed4443b84997592b22f42099cb8b6bbe0cd524 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Tue, 10 Sep 2024 22:28:43 -0700 Subject: [PATCH 1/5] Improve stability of hostnames test Signed-off-by: Madelyn Olson --- tests/unit/cluster/hostnames.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/cluster/hostnames.tcl b/tests/unit/cluster/hostnames.tcl index 232c6cf818..036fb5cd9e 100644 --- a/tests/unit/cluster/hostnames.tcl +++ b/tests/unit/cluster/hostnames.tcl @@ -136,7 +136,7 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne # they'll hang in the handshake phase. This allows us to # test the case where we "know" about it but haven't # successfully retrieved information about it yet. - R 0 DEBUG DROP-CLUSTER-PACKET-FILTER 0 + pause_process [srv 0 pid] R 6 DEBUG DROP-CLUSTER-PACKET-FILTER 0 # Have a replica meet the isolated node @@ -174,12 +174,12 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne # Also make sure we know about the isolated master, we # just can't reach it. + resume_process [srv 0 pid] set master_id [R 0 CLUSTER MYID] assert_match "*$master_id*" [R 6 CLUSTER NODES] # Stop dropping cluster packets, and make sure everything # stabilizes - R 0 DEBUG DROP-CLUSTER-PACKET-FILTER -1 R 6 DEBUG DROP-CLUSTER-PACKET-FILTER -1 # This operation sometimes spikes to around 5 seconds to resolve the state, From e4582bcc9e7824f111ce6f2c21ecd1877112e1c1 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 11 Sep 2024 08:38:31 -0700 Subject: [PATCH 2/5] Address comment Signed-off-by: Madelyn Olson --- tests/unit/cluster/hostnames.tcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/cluster/hostnames.tcl b/tests/unit/cluster/hostnames.tcl index 036fb5cd9e..e2cd7a630d 100644 --- a/tests/unit/cluster/hostnames.tcl +++ b/tests/unit/cluster/hostnames.tcl @@ -132,6 +132,9 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne R $j config set cluster-announce-hostname "shard-$j.com" } + # Grab the ID so we have it for later for validation + set primary [R 0 CLUSTER MYID] + # Prevent Node 0 and Node 6 from properly meeting, # they'll hang in the handshake phase. This allows us to # test the case where we "know" about it but haven't @@ -174,12 +177,12 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne # Also make sure we know about the isolated master, we # just can't reach it. - resume_process [srv 0 pid] set master_id [R 0 CLUSTER MYID] assert_match "*$master_id*" [R 6 CLUSTER NODES] # Stop dropping cluster packets, and make sure everything # stabilizes + resume_process [srv 0 pid] R 6 DEBUG DROP-CLUSTER-PACKET-FILTER -1 # This operation sometimes spikes to around 5 seconds to resolve the state, From ada83661de368a1367adfbaf6f35b11f0ae67da1 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 11 Sep 2024 08:39:17 -0700 Subject: [PATCH 3/5] Use inclusive language Signed-off-by: Madelyn Olson --- tests/unit/cluster/hostnames.tcl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/cluster/hostnames.tcl b/tests/unit/cluster/hostnames.tcl index e2cd7a630d..cb60ad1d0d 100644 --- a/tests/unit/cluster/hostnames.tcl +++ b/tests/unit/cluster/hostnames.tcl @@ -177,8 +177,7 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne # Also make sure we know about the isolated master, we # just can't reach it. - set master_id [R 0 CLUSTER MYID] - assert_match "*$master_id*" [R 6 CLUSTER NODES] + assert_match "*$primary_id*" [R 6 CLUSTER NODES] # Stop dropping cluster packets, and make sure everything # stabilizes From 8f779ec0fa44f66950876f19ed5ba6b7f676967a Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 11 Sep 2024 08:39:41 -0700 Subject: [PATCH 4/5] Change variable name Signed-off-by: Madelyn Olson --- tests/unit/cluster/hostnames.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/cluster/hostnames.tcl b/tests/unit/cluster/hostnames.tcl index cb60ad1d0d..350d008aef 100644 --- a/tests/unit/cluster/hostnames.tcl +++ b/tests/unit/cluster/hostnames.tcl @@ -133,7 +133,7 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne } # Grab the ID so we have it for later for validation - set primary [R 0 CLUSTER MYID] + set primary_id [R 0 CLUSTER MYID] # Prevent Node 0 and Node 6 from properly meeting, # they'll hang in the handshake phase. This allows us to From 308357de62393d1be45da9293dd9dc6c4146d8df Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 11 Sep 2024 08:40:29 -0700 Subject: [PATCH 5/5] Fix a typo Fix a typo Signed-off-by: Madelyn Olson --- tests/unit/cluster/hostnames.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/cluster/hostnames.tcl b/tests/unit/cluster/hostnames.tcl index 350d008aef..9a74fd0d56 100644 --- a/tests/unit/cluster/hostnames.tcl +++ b/tests/unit/cluster/hostnames.tcl @@ -132,7 +132,7 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne R $j config set cluster-announce-hostname "shard-$j.com" } - # Grab the ID so we have it for later for validation + # Grab the ID so we have it later for validation set primary_id [R 0 CLUSTER MYID] # Prevent Node 0 and Node 6 from properly meeting,