]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Better handling of the result of redis cluster node failure
authorNick Porter <nick@portercomputing.co.uk>
Thu, 12 Sep 2024 10:23:37 +0000 (11:23 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 12 Sep 2024 11:07:42 +0000 (12:07 +0100)
src/tests/modules/redis/cluster_node_fail.unlang

index 0bdbb9c6496b6cab62f45093503d58aa9fc8aa7c..e415ec58699253451fd220080923f8994df76585 100644 (file)
@@ -3,6 +3,7 @@
 #
 string redismaster
 string redisreplica
+string takeoverresult
 
 $INCLUDE cluster_reset.inc
 
@@ -26,7 +27,11 @@ if (%redis(@%redis.node(b, 0), DEBUG, SEGFAULT)) {
 }
 
 #  Forcefully failover the slave for that node
-if (!(%redis(@%{redisreplica}, CLUSTER, FAILOVER, TAKEOVER) == 'OK')) {
+#  If the failover has happened automatically, then the result is ''
+#  which sometimes happens when running tests with sanitizers, due to
+#  slowness introduced by the sanitizers.
+&takeoverresult = %redis(@%{redisreplica}, CLUSTER, FAILOVER, TAKEOVER)
+if !((&takeoverresult == 'OK') || (&takeoverresult == '')) {
        test_fail
 }