redict/tests/unit
Oran Agra 497351ad07
Fix SLOWLOG for blocked commands (#8632)
* SLOWLOG didn't record anything for blocked commands because the client
  was reset and argv was already empty. there was a fix for this issue
  specifically for modules, now it works for all blocked clients.
* The original command argv (before being re-written) was also reset
  before adding the slowlog on behalf of the blocked command.
* Latency monitor is now updated regardless of the slowlog flags of the
  command or its execution (their purpose is to hide sensitive info from
  the slowlog, not hide the fact the latency happened).
* Latency monitor now uses real_cmd rather than c->cmd (which may be
  different if the command got re-written, e.g. GEOADD)

Changes:
* Unify shared code between slowlog insertion in call() and
  updateStatsOnUnblock(), hopefully prevent future bugs from happening
  due to the later being overlooked.
* Reset CLIENT_PREVENT_LOGGING in resetClient rather than after command
  processing.
* Add a test for SLOWLOG and BLPOP

Notes:
- real_cmd == c->lastcmd, except inside MULTI and Lua.
- blocked commands never happen in these cases (MULTI / Lua)
- real_cmd == c->cmd, except for when the command is rewritten (e.g.
  GEOADD)
- blocked commands (currently) are never rewritten
- other than the command's CLIENT_PREVENT_LOGGING, and the
  execution flag CLIENT_PREVENT_LOGGING, other cases that we want to
  avoid slowlog are on AOF loading (specifically CMD_CALL_SLOWLOG will
  be off when executed from execCommand that runs from an AOF)
2021-03-25 10:20:27 +02:00
..
moduleapi Missing EXEC on modules propagation after failed EVAL execution (#8654) 2021-03-15 21:19:57 +02:00
type RAND* commands: fix risk of OOM panic in hash and zset, use fair random in hash, and add tests for even distribution to all (#8429) 2021-02-05 15:56:20 +02:00
acl.tcl Process hello command even if the default user has no permissions. (#8633) 2021-03-10 21:19:35 -08:00
aofrw.tcl AOF: run tests with preamble off when it makes sense. 2018-03-25 13:03:38 +02:00
auth.tcl Handle binary safe string for REQUIREPASS and MASTERAUTH directives (#8200) 2020-12-17 09:26:33 -08:00
bitfield.tcl Fix BITFIELD_RO test. 2020-03-23 12:02:12 +01:00
bitops.tcl Regression test for #3282. 2016-06-15 11:49:49 +02:00
dump.tcl Fix recent test failures (#8386) 2021-01-23 21:53:58 +02:00
expire.tcl EXPIRE, EXPIREAT, SETEX, GETEX: Return error when expire time overflows (#8287) 2021-02-21 09:09:54 +02:00
geo.tcl Fix GEOSEARCH tcl test error (#8451) 2021-02-04 19:39:07 +02:00
hyperloglog.tcl Squash merging 125 typo/grammar/comment/doc PRs (#7773) 2020-09-10 13:43:38 +03:00
info.tcl Use addReplyErrorObject with shared.noscripterr (#8544) 2021-02-24 08:45:13 -08:00
introspection-2.tcl EXISTS should not alter LRU, OBJECT should not reveal expired keys on replica (#8016) 2020-11-18 11:16:21 +02:00
introspection.tcl Make port, tls-port and bind configurations modifiable (#8510) 2021-03-01 16:04:44 +02:00
keyspace.tcl Improve dbid range check for SELECT, MOVE, COPY (#8085) 2020-12-01 21:41:26 +02:00
latency-monitor.tcl Add a --no-latency tests flag. (#7939) 2020-10-22 11:10:53 +03:00
lazyfree.tcl Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
limits.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
maxmemory.tcl Fix flaky unit/maxmemory test on MacOS/BSD. (#8619) 2021-03-08 20:53:53 +02:00
memefficiency.tcl Skip defrag tests on systems with bigger page sizes (#8294) 2021-01-08 10:03:21 +02:00
multi.tcl Swapdb should make transaction fail if there is any client watching keys (#8239) 2021-01-04 14:48:28 +02:00
networking.tcl fix new networking tests to work when the test suite is used in tls mode (#8582) 2021-03-01 20:53:02 +02:00
obuf-limits.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
oom-score-adj.tcl Fix timing error oom-score-adj test (#8513) 2021-02-19 13:01:25 +02:00
other.tcl Remove cron saving during BGSAVE test. (#8688) 2021-03-24 15:14:47 +02:00
pause.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
pendingquerybuf.tcl Slave removal: remove slave from top-level tests descriptions. 2018-09-11 15:32:28 +02:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
pubsub.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scan.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
scripting.tcl Fix script kill to work also on scripts that use pcall (#8661) 2021-03-17 18:52:11 +02:00
shutdown.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
slowlog.tcl Fix SLOWLOG for blocked commands (#8632) 2021-03-25 10:20:27 +02:00
sort.tcl Config: Add quicklist, remove old list options 2015-01-02 11:16:10 -05:00
tls.tcl Add support for reading encrypted keyfiles. (#8644) 2021-03-22 13:27:46 +02:00
tracking.tcl Client tracking tracking-redir-broken push len is 2 not 3 (#8456) 2021-02-21 09:34:46 +02:00
wait.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00