Fix cluster hostnames test causing failover while running valgrind (#10991)

In the newly added cluster hostnames test, the primary is failing over during the reboot
for valgrind so we are validating the wrong node. This change just sets the replica to
prevent taking over, which seems to fix the test.

We could have also set the timeout higher, but it slows down the test.
This commit is contained in:
Madelyn Olson 2022-07-16 23:57:34 -07:00 committed by GitHub
parent 2d3240f31b
commit 3abdec9969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -203,8 +203,14 @@ test "Verify the nodes configured with prefer hostname only show hostname for ne
test "Test restart will keep hostname information" {
# Set a new hostname, reboot and make sure it sticks
R 0 config set cluster-announce-hostname "restart-1.com"
# Store the hostname in the config
R 0 config rewrite
# If the primary is slow to reboot it might get demoted, so prevent the replica
# from nominating itself.
R 3 config set cluster-replica-no-failover yes
restart_server 0 true false
set slot_result [R 0 CLUSTER SLOTS]
assert_equal [lindex [get_slot_field $slot_result 0 2 3] 1] "restart-1.com"