From bfe50a30edff6837897964ac3374c082b0d9e5da Mon Sep 17 00:00:00 2001 From: Binbin Date: Sat, 4 Mar 2023 18:54:36 +0800 Subject: Increase the threshold of the AOF loading defrag test (#11871) This test is very sensitive and fragile. It often fails in Daily, in most cases, it failed in test-ubuntu-32bit (the AOF loading one), with the range in (31, 40): ``` [err]: Active defrag in tests/unit/memefficiency.tcl Expected 38 <= 30 (context: type eval line 113 cmd {assert {$max_latency <= 30}} proc ::test) ``` The AOF loading part isn't tightly fixed to the cron hz. It calls processEventsWhileBlocked once in every 1024 command calls. ``` /* Serve the clients from time to time */ if (!(loops++ % 1024)) { off_t progress_delta = ftello(fp) - last_progress_report_size; loadingIncrProgress(progress_delta); last_progress_report_size += progress_delta; processEventsWhileBlocked(); processModuleLoadingProgressEvent(1); } ``` In this case, we can either decrease the 1024 or increase the threshold of just the AOF part of that test. Considering the test machines are sometimes slow, and all sort of quirks could happen (which do not indicate a bug), and we've already set to 30, we suppose we can set it a little bit higher, set it to 40. We can have this instead of adding another testing config (we can add it when we really need it). Fixes #11868 --- tests/unit/memefficiency.tcl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/memefficiency.tcl b/tests/unit/memefficiency.tcl index 7bf821e5c..d821c7adc 100644 --- a/tests/unit/memefficiency.tcl +++ b/tests/unit/memefficiency.tcl @@ -116,6 +116,7 @@ start_server {tags {"defrag external:skip"} overrides {appendonly yes auto-aof-r # if defrag is supported, test AOF loading too if {[r config get activedefrag] eq "activedefrag yes"} { + test "Active defrag - AOF loading" { # reset stats and load the AOF file r config resetstat r config set key-load-delay -25 ;# sleep on average 1/25 usec @@ -148,12 +149,13 @@ start_server {tags {"defrag external:skip"} overrides {appendonly yes auto-aof-r # make sure the defragger did enough work to keep the fragmentation low during loading. # we cannot check that it went all the way down, since we don't wait for full defrag cycle to complete. assert {$frag < 1.4} - # since the AOF contains simple (fast) SET commands (and the cron during loading runs every 1000 commands), + # since the AOF contains simple (fast) SET commands (and the cron during loading runs every 1024 commands), # it'll still not block the loading for long periods of time. if {!$::no_latency} { - assert {$max_latency <= 30} + assert {$max_latency <= 40} } } + } ;# Active defrag - AOF loading } r config set appendonly no r config set key-load-delay 0 -- cgit v1.2.1