Unverified Commit 880e147d authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

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.
parent b10e19e3
...@@ -68,10 +68,10 @@ start_server {tags {"cli"}} { ...@@ -68,10 +68,10 @@ start_server {tags {"cli"}} {
set _ [format_output [read_cli $fd]] set _ [format_output [read_cli $fd]]
} }
# Note: prompt may be affected by the local history, if failed, please file delete ./.rediscli_history_test
# try using `rm ~/.rediscli_history` to delete it and then retry.
proc test_interactive_cli_with_prompt {name code} { proc test_interactive_cli_with_prompt {name code} {
set ::env(FAKETTY_WITH_PROMPT) 1 set ::env(FAKETTY_WITH_PROMPT) 1
set ::env(REDISCLI_HISTFILE) ".rediscli_history_test"
test_interactive_cli $name $code test_interactive_cli $name $code
unset ::env(FAKETTY_WITH_PROMPT) unset ::env(FAKETTY_WITH_PROMPT)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment