summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-07 21:27:09 +0800
committerGitHub <noreply@github.com>2023-03-07 15:27:09 +0200
commit9958ab8b2cd17681962f5de83e6a94cf4189e9f3 (patch)
tree56dbc3a6fe5ce77a51524f9abdf86beb29b98c08 /tests/unit
parent3fba3ccd96b066d10401f1f9b65293d59d14082c (diff)
downloadredis-9958ab8b2cd17681962f5de83e6a94cf4189e9f3.tar.gz
Solve race in CLIENT NO-TOUCH lru test (#11883)
I've seen it fail here (test-centos7-tls-module-no-tls and test-freebsd): ``` *** [err]: Operations in no-touch mode do not alter the last access time of a key in tests/unit/introspection-2.tcl Expected '244296' to be more than '244296' (context: type eval line 12 cmd {assert_morethan $newlru $oldlru} proc ::test) ``` Our LRU_CLOCK_RESOLUTION value is 1000ms, and default hz is 10, so if the test is really fast, or the timing is just right, newlru will be the same as oldlru. We fixed this by changing `after 1000` to `after 1100`.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/introspection-2.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/introspection-2.tcl b/tests/unit/introspection-2.tcl
index 2992f6aa3..a0cf0c30f 100644
--- a/tests/unit/introspection-2.tcl
+++ b/tests/unit/introspection-2.tcl
@@ -41,7 +41,7 @@ start_server {tags {"introspection"}} {
r set foo bar
r client no-touch on
set oldlru [getlru foo]
- after 1000
+ after 1100
r get foo
set newlru [getlru foo]
assert_equal $newlru $oldlru