summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-20 17:58:20 +0800
committerGitHub <noreply@github.com>2023-03-20 11:58:20 +0200
commitc91241451b5de214392028a4ce81adad8359e77f (patch)
tree75da710ba4b28136b61e5c065812ff26608833f4 /tests/integration
parent56eef6fb5ab7a755485c19f358761954ca459472 (diff)
downloadredis-c91241451b5de214392028a4ce81adad8359e77f.tar.gz
Fix new subscribe mode test in reply-schemas-validator (#11939)
The reason is in reply-schemas-validator, the resp of the client we create will be client_default_resp (currently 3): ``` client *createClient(connection *conn) { client *c = zmalloc(sizeof(client)); #ifdef LOG_REQ_RES reqresReset(c, 0); c->resp = server.client_default_resp; #else c->resp = 2; #endif } ``` But current_resp3 in redis-cli will be inconsistent with it, the test adds a simple hello 3 to avoid this failure, test was added in #11873. Added help descriptions for dont-pre-clean option, it was added in #10273
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/redis-cli.tcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/integration/redis-cli.tcl b/tests/integration/redis-cli.tcl
index 50f4a2e83..2c39d720a 100644
--- a/tests/integration/redis-cli.tcl
+++ b/tests/integration/redis-cli.tcl
@@ -194,6 +194,10 @@ start_server {tags {"cli"}} {
}
test_interactive_cli "Subscribed mode" {
+ if {$::force_resp3} {
+ run_command $fd "hello 3"
+ }
+
set reading "Reading messages... (press Ctrl-C to quit or any key to type command)\r"
set erase "\033\[K"; # Erases the "Reading messages..." line.
@@ -215,6 +219,8 @@ start_server {tags {"cli"}} {
assert_equal $erase$unsub1$unsub2$reading \
[run_command $fd "unsubscribe ch1 ch2"]
+ run_command $fd "hello 2"
+
# Command forbidden in subscribed mode (RESP2).
set err "(error) ERR Can't execute 'get': only (P|S)SUBSCRIBE / (P|S)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this context\n"
assert_equal $erase$err$reading [run_command $fd "get k"]