From 880e147d52433b81388e5b476a7d5b3f018c8e8b Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Mon, 15 Jul 2024 15:24:43 +0300 Subject: [PATCH] solve redis-cli test failures due to local history file (#13419) test failure: ``` [err]: Interactive CLI: should find second search result if user presses ctrl+s in tests/integration/redis-cli.tcl Expected '1' to be equal to '0' (context: type eval line 10 cmd {assert_equal 1 [regexp {\(i-search\): \x1B\[0mk\x1B\[1mey\x1B\[0ms one} $result]} proc ::test) ``` this test (introduced in #12543) depends on the local history file, so it can fail if there's some match there. the fix is to use a different history file, and delete it before each run. --- tests/integration/redis-cli.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/redis-cli.tcl b/tests/integration/redis-cli.tcl index 55b575040..252daf747 100644 --- a/tests/integration/redis-cli.tcl +++ b/tests/integration/redis-cli.tcl @@ -68,10 +68,10 @@ start_server {tags {"cli"}} { set _ [format_output [read_cli $fd]] } - # Note: prompt may be affected by the local history, if failed, please - # try using `rm ~/.rediscli_history` to delete it and then retry. + file delete ./.rediscli_history_test proc test_interactive_cli_with_prompt {name code} { set ::env(FAKETTY_WITH_PROMPT) 1 + set ::env(REDISCLI_HISTFILE) ".rediscli_history_test" test_interactive_cli $name $code unset ::env(FAKETTY_WITH_PROMPT) }