diff options
author | Madelyn Olson <34459052+madolson@users.noreply.github.com> | 2022-04-14 01:18:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 11:18:32 +0300 |
commit | effa707e9db3e9d00fff06d45e2a5a81d3d55fa9 (patch) | |
tree | eb2214698dd05230bbb81337a26bba094de82a81 /tests/unit/introspection.tcl | |
parent | 95050f2683173e2bb8b05b297e44809cd09316c6 (diff) | |
download | redis-effa707e9db3e9d00fff06d45e2a5a81d3d55fa9.tar.gz |
Fix incorrect error code for eval scripts and fix test error checking (#10575)
By the convention of errors, there is supposed to be a space between the code and the name.
While looking at some lua stuff I noticed that interpreter errors were not adding the space,
so some clients will try to map the detailed error message into the error.
We have tests that hit this condition, but they were just checking that the string "starts" with ERR.
I updated some other tests with similar incorrect string checking. This isn't complete though, as
there are other ways we check for ERR I didn't fix.
Produces some fun output like:
```
# Errorstats
errorstat_ERR:count=1
errorstat_ERRuser_script_1_:count=1
```
Diffstat (limited to 'tests/unit/introspection.tcl')
-rw-r--r-- | tests/unit/introspection.tcl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/unit/introspection.tcl b/tests/unit/introspection.tcl index c530a31d3..339d4c731 100644 --- a/tests/unit/introspection.tcl +++ b/tests/unit/introspection.tcl @@ -23,9 +23,9 @@ start_server {tags {"introspection"}} { assert_error "ERR wrong number of arguments for 'client|kill' command" {r client kill} assert_error "ERR syntax error*" {r client kill id 10 wrong_arg} - assert_error "ERR*greater than 0*" {r client kill id str} - assert_error "ERR*greater than 0*" {r client kill id -1} - assert_error "ERR*greater than 0*" {r client kill id 0} + assert_error "ERR *greater than 0*" {r client kill id str} + assert_error "ERR *greater than 0*" {r client kill id -1} + assert_error "ERR *greater than 0*" {r client kill id 0} assert_error "ERR Unknown client type*" {r client kill type wrong_type} @@ -409,11 +409,11 @@ start_server {tags {"introspection"}} { } test {CONFIG SET duplicate configs} { - assert_error "ERR*duplicate*" {r config set maxmemory 10000001 maxmemory 10000002} + assert_error "ERR *duplicate*" {r config set maxmemory 10000001 maxmemory 10000002} } test {CONFIG SET set immutable} { - assert_error "ERR*immutable*" {r config set daemonize yes} + assert_error "ERR *immutable*" {r config set daemonize yes} } test {CONFIG GET hidden configs} { @@ -448,8 +448,8 @@ start_server {tags {"introspection"}} { start_server {tags {"introspection external:skip"} overrides {enable-protected-configs {no} enable-debug-command {no}}} { test {cannot modify protected configuration - no} { - assert_error "ERR*protected*" {r config set dir somedir} - assert_error "ERR*DEBUG command not allowed*" {r DEBUG HELP} + assert_error "ERR *protected*" {r config set dir somedir} + assert_error "ERR *DEBUG command not allowed*" {r DEBUG HELP} } {} {needs:debug} } @@ -464,8 +464,8 @@ start_server {config "minimal.conf" tags {"introspection external:skip"} overrid if {$myaddr != "" && ![string match {127.*} $myaddr]} { # Non-loopback client should fail set r2 [get_nonloopback_client] - assert_error "ERR*protected*" {$r2 config set dir somedir} - assert_error "ERR*DEBUG command not allowed*" {$r2 DEBUG HELP} + assert_error "ERR *protected*" {$r2 config set dir somedir} + assert_error "ERR *DEBUG command not allowed*" {$r2 DEBUG HELP} } } {} {needs:debug} } |