From: Nick Porter Date: Wed, 1 Feb 2023 20:54:02 +0000 (+0000) Subject: Allow redis cluster time to propagate changes after failover X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2924c39081bd4c1ae44179976056bf9603a02fbc;p=thirdparty%2Ffreeradius-server.git Allow redis cluster time to propagate changes after failover --- diff --git a/src/tests/modules/redis/cluster_node_fail.unlang b/src/tests/modules/redis/cluster_node_fail.unlang index c54d338afdb..07ffff80408 100644 --- a/src/tests/modules/redis/cluster_node_fail.unlang +++ b/src/tests/modules/redis/cluster_node_fail.unlang @@ -11,6 +11,9 @@ if (!("%(redis:SET b 'boom')" == 'OK')) { # Leave some time (100ms) for the synchronisation &Tmp-String-0 := `/bin/sleep 0.1` +# Note the current master +&Tmp-Integer-0 := %(redis_node:b 0) + # Cause one of the redis cluster nodes to SEGV if ("%(redis:@%(redis_node:b 0) DEBUG SEGFAULT)" != '') { test_fail @@ -21,6 +24,14 @@ if (!("%(redis:@%(redis_node:b 1) CLUSTER FAILOVER TAKEOVER)" == 'OK')) { test_fail } +# Allow time for the takeover to propagate to other nodes +foreach &control.Tmp-Integer-0 { + if (%(redis_node:b 0) != &Tmp-Integer-0) { + break + } + &Tmp-String-0 := `/bin/sleep 0.5` +} + if (!("%(redis:GET b)" == 'boom')) { test_fail }