Commit Graph

41 Commits

Author SHA1 Message Date
bodong.ybd
f22fa9594d Tests: Some fixes for macOS
1) cur_test: when restart_server, "no such variable" error occurs
  ./runtest --single integration/rdb
  test {client freed during loading}
      SET ::cur_test
      restart_server
        kill_server
          test "Check for memory leaks (pid $pid)"
          SET ::cur_test
          UNSET ::cur_test
      UNSET ::cur_test // This global variable has been unset.

2) `ps --ppid` not available on macOS platform, can be replaced with
`pgrep -P pid`.
2020-09-08 14:27:53 +08:00
Oran Agra
fe5da2e60d test infra - add durable mode to work around test suite crashing
in some cases a command that returns an error possibly due to a timing
issue causes the tcl code to crash and thus prevents the rest of the
tests from running. this adds an option to make the test proceed despite
the crash.
maybe it should be the default mode some day.
2020-09-06 09:59:19 +03:00
Oran Agra
677d14c213 test infra - improve test skipping ability
- skip full units
- skip a single test (not just a list of tests)
- when skipping tag, skip spinning up servers, not just the tests
- skip tags when running against an external server too
- allow using multiple tags (split them)
2020-09-06 09:59:19 +03:00
Oran Agra
9d527d076b test infra - write test name to logfile 2020-09-06 09:59:19 +03:00
Oran Agra
02ef355f98
runtest --stop pause stops before terminating the redis server (#7513)
in the majority of the cases (on this rarely used feature) we want to
stop and be able to connect to the shard with redis-cli.
since these are two different processes interracting with the tty we
need to stop both, and we'll have to hit enter twice, but it's not that
bad considering it is rarely used.
2020-07-13 16:09:08 +03:00
Oran Agra
a0cfd519e3 test infra: improve prints on failed assertions
sometimes we have several assertions with the same condition in the same test
at different stages, and when these fail (the ones that print the condition
text) you don't know which one it was. other assertions didn't print the
condition text (variable names), just the expected and unexpected values.

So now, all assertions print context line, and conditin text.

besides, one of the major differences between 'assert' and 'assert_equal',
is that the later is able to print the value that doesn't match the expected.
if there is a rare non-reproducible failure, it is helpful to know what was
the value the test encountered and how far it was from the threshold.

So now, adding assert_lessthan and assert_range that can be used in some places.
were we used just 'assert { a > b }' so far.
2019-10-29 17:38:12 +02:00
Madelyn Olson
ea7c3fe7fd Allowed passing in of password hash and fixed config rewrite 2019-09-30 17:57:49 +02:00
Oran Agra
7829287691 test suite conveniency improvements
* allowing --single to be repeated
* adding --only so that only a specific test inside a unit can be run
* adding --skiptill useful to resume a test that crashed passed the problematic unit.
  useful together with --clients 1
* adding --skipfile to use a file containing list of tests names to skip
* printing the names of the tests that are skiped by skipfile or denytags
* adding --config to add config file options from command line
2018-07-30 19:13:15 +03:00
Oran Agra
5e3880a492 various cleanups and minor fixes 2016-04-25 16:49:57 +03:00
Matt Stancliff
5e362b84ab Add quicklist implementation
This replaces individual ziplist vs. linkedlist representations
for Redis list operations.

Big thanks for all the reviews and feedback from everybody in
https://github.com/antirez/redis/pull/2143
2015-01-02 11:16:08 -05:00
Matt Stancliff
09cb281bc3 Fix spelling in some test cases 2014-09-29 06:49:08 -04:00
antirez
8c254415f7 Sentinel test: framework improved and conf-update unit added.
It is now possible to kill and restart sentinel or redis instances for
more real-world testing.

The 01 unit tests the capability of Sentinel to update the configuration
of Sentinels rejoining the cluster, however the test is pretty trivial
and more tests should be added.
2014-02-22 17:27:49 +01:00
antirez
34c404e069 Test: colorstr moved to util.tcl. 2014-02-17 17:36:50 +01:00
antirez
28ccb53008 Redis test: More reliable BRPOPLPUSH replication test.
Now it uses the new wait_for_condition testing primitive.
Also wait_for_condition implementation was fixed in this commit to properly
escape the expr command and its argument.
2012-04-26 11:25:13 +02:00
antirez
5080e625d3 Redis test: scripting EVALSHA replication test more reliable.
A new primitive wait_for_condition was introduced in the scripting
engine that makes waiting for events simpler, so that it is simpler to
write tests that are more resistant to timing issues.
2012-04-26 11:16:52 +02:00
antirez
414c3deac1 Regression test for the main problem causing issue #141. Minor changes/fixes/additions to the test suite itself needed to write the test. 2012-01-06 17:28:40 +01:00
antirez
202e3091d7 Redis test: when assertion fails print not just the expression but also expanded values in the error message. 2011-12-21 09:23:22 +01:00
antirez
e54484876a fixed assert proc on Redis test 2011-07-28 12:31:44 +02:00
antirez
121ffc85f4 better recap of failed tests. 2011-07-11 12:56:00 +02:00
antirez
82e5dd35ea display less useless information in parallel test 2011-07-11 00:14:12 +02:00
antirez
3744824c3e some test colorization and some fix 2011-07-11 00:09:56 +02:00
antirez
13566085cf Initial implementation of a client-server parallel testing system for Redis in order to speedup execution of the test suite. 2011-07-10 23:25:48 +02:00
antirez
4a67d194e9 fixed color support for test suite. Now colors are shown as long as there is xterm somewhere inside the TERM env var 2011-02-22 16:41:27 +01:00
antirez
180e07b8c0 fixed test rendering when test failed in non verbose mode 2010-12-15 11:04:04 +01:00
antirez
7982173fef print test names inline in the non verbose output mode 2010-12-15 10:44:36 +01:00
antirez
eae9cce166 colorized make test output when the verbose output is disabled (default) 2010-12-15 10:14:34 +01:00
Pieter Noordhuis
6f8a32d5c7 Be less verbose in testing; improve error handling 2010-12-10 16:13:21 +01:00
Pieter Noordhuis
5b12b47df9 Show output of leaks command on a leak 2010-10-15 15:56:16 +02:00
Pieter Noordhuis
6825491928 Fix assertion function on value encoding 2010-08-01 11:20:26 +02:00
Pieter Noordhuis
86d392498b ensure the value is swapped in before testing its encoding 2010-07-29 13:31:24 +02:00
Pieter Noordhuis
c2ff0e90b8 more pub/sub tests 2010-06-16 11:03:23 +02:00
Pieter Noordhuis
5eedc9c65e tests for BLPOP/BRPOP via an option in the tcl client that defers reading the reply 2010-06-15 21:23:18 +02:00
Pieter Noordhuis
08b5920750 change ltrim tests to cover all min/max cases and add stronger stresser 2010-06-14 09:45:34 +02:00
Pieter Noordhuis
d4507ec615 refactor list tests to test both encodings; implemented assert functions 2010-06-04 16:31:27 +02:00
Pieter Noordhuis
73bd6c583b pass tags to filter and match via arguments 2010-06-02 23:22:20 +02:00
Pieter Noordhuis
6e0e5bedd9 basic support to tag tests 2010-06-02 22:53:22 +02:00
Pieter Noordhuis
38273a9ed6 removed obsolete code 2010-06-02 21:53:15 +02:00
Pieter Noordhuis
436f18b618 catch exceptions in the server proc, to be able to kill the entire chain of running servers 2010-06-02 21:53:10 +02:00
antirez
9b30e1a207 WATCH is now able to detect keys removed by FLUSHALL and FLUSHDB 2010-05-25 19:30:24 +02:00
Pieter Noordhuis
fdfb02e7ff print warnings in redis log when a test raises an exception (very likely to be caused by something like a failed assertion) 2010-05-15 23:48:08 +02:00
antirez
ab72b4833d minor fixes to the new test suite, html doc updated 2010-05-14 18:48:33 +02:00