From: Arran Cudbard-Bell Date: Thu, 13 Apr 2023 07:11:06 +0000 (+1000) Subject: redis: Fix timing issues in cluster reset X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07ab29c5e627f960ce3ba0c7336e963f542ab095;p=thirdparty%2Ffreeradius-server.git redis: Fix timing issues in cluster reset It takes 5-6 seconds for replicas to appear in the output of cluster slots --- diff --git a/src/tests/modules/redis/cluster_reset.inc b/src/tests/modules/redis/cluster_reset.inc index 4de0893639..ae4a42a0d7 100644 --- a/src/tests/modules/redis/cluster_reset.inc +++ b/src/tests/modules/redis/cluster_reset.inc @@ -15,6 +15,17 @@ &Tmp-Integer-0 = 8 &Tmp-Integer-0 = 9 &Tmp-Integer-0 = 10 + &Tmp-Integer-0 = 11 + &Tmp-Integer-0 = 12 + &Tmp-Integer-0 = 13 + &Tmp-Integer-0 = 14 + &Tmp-Integer-0 = 15 + &Tmp-Integer-0 = 16 + &Tmp-Integer-0 = 17 + &Tmp-Integer-0 = 18 + &Tmp-Integer-0 = 19 + &Tmp-Integer-0 = 20 + &Tmp-Integer-0 = 21 } &control.Tmp-String-0 := "1-%{randstr:aaaaaaaa}" @@ -75,15 +86,18 @@ foreach &control.Tmp-Integer-0 { &request -= &Module-Failure-Message[*] - # Perform checks every 0.5 seconds - &Tmp-Integer-0 := `/bin/sleep 0.5` + # Perform checks every half second for 10 seconds. + # + # The cluster tends to come up within a couple of seconds, but it takes longer + # for the replicas to be displayed in cluster slot output (usually ~5 seconds). + %(delay:0.5) # # If the cluster is still not behaving # abandon the test to avoid false negatives # - if ("%{Foreach-Variable-0}" == 10) { - test_pass + if ("%{Foreach-Variable-0}" == 20) { + test_fail return } } diff --git a/src/tests/modules/redis/module.conf b/src/tests/modules/redis/module.conf index abcdfae952..8d5173c8b6 100644 --- a/src/tests/modules/redis/module.conf +++ b/src/tests/modules/redis/module.conf @@ -93,3 +93,6 @@ redis { # or increase lifetime/idle_timeout. } } + +delay { +}