diff options
author | chenyang8094 <chenyang8094@users.noreply.github.com> | 2022-01-25 04:31:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 22:31:35 +0200 |
commit | fa600496482dcfdbf4b5af7c27b7a2eda02ac586 (patch) | |
tree | 225e87b9243dd1216b8d3dd8f3c042db87f78eb2 /tests/integration/aof.tcl | |
parent | 495ac8b79a4566abd05e201f06334cdd570258ef (diff) | |
download | redis-fa600496482dcfdbf4b5af7c27b7a2eda02ac586.tar.gz |
Fix EVAL timeout test failed on freebsd (#10098)
* Refactor EVAL timeout test
* since the test used r config set appendonly yes which generates a rewrite, it missed it's purpose
* Fix the bug that start_server returns before redis starts ready, which affects when multiple tests share the same dir.
* Elapsed time tracking no loner needed
Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'tests/integration/aof.tcl')
-rw-r--r-- | tests/integration/aof.tcl | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/integration/aof.tcl b/tests/integration/aof.tcl index bc88f2487..28b3b0e5e 100644 --- a/tests/integration/aof.tcl +++ b/tests/integration/aof.tcl @@ -478,26 +478,26 @@ tags {"aof external:skip"} { } test {EVAL timeout with slow verbatim Lua script from AOF} { - create_aof $aof_dirpath $aof_file { - append_to_aof [formatCommand select 9] - append_to_aof [formatCommand eval {redis.call('set',KEYS[1],'y'); for i=1,1500000 do redis.call('ping') end return 'ok'} 1 x] - } - - start_server [list overrides [list dir $server_path appendonly no lua-time-limit 1 aof-use-rdb-preamble no]] { + start_server [list overrides [list dir $server_path appendonly yes lua-time-limit 1 aof-use-rdb-preamble no]] { # generate a long running script that is propagated to the AOF as script # make sure that the script times out during loading + create_aof $aof_dirpath $aof_file { + append_to_aof [formatCommand select 9] + append_to_aof [formatCommand eval {redis.call('set',KEYS[1],'y'); for i=1,1500000 do redis.call('ping') end return 'ok'} 1 x] + } set rd [redis_deferring_client] - r config set appendonly yes - set start [clock clicks -milliseconds] $rd debug loadaof $rd flush - after 100 + wait_for_condition 100 10 { + [s loading] == 1 + } else { + fail "server didn't start loading" + } catch {r ping} err assert_match {LOADING*} $err $rd read - set elapsed [expr [clock clicks -milliseconds]-$start] - if {$::verbose} { puts "loading took $elapsed milliseconds" } $rd close + wait_for_log_messages 0 {"*Slow script detected*"} 0 100 100 assert_equal [r get x] y } } |