diff --git a/tests/unit/cluster/hostnames.tcl b/tests/unit/cluster/hostnames.tcl index 232c6cf81..9a74fd0d5 100644 --- a/tests/unit/cluster/hostnames.tcl +++ b/tests/unit/cluster/hostnames.tcl @@ -132,11 +132,14 @@ 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 later for validation + 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 # 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 +177,11 @@ 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 - R 0 DEBUG DROP-CLUSTER-PACKET-FILTER -1 + 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,