138 Commits

Author SHA1 Message Date
Yossi Gottlieb
f0e28abc07 Add oom-score-adj configuration option to control Linux OOM killer. (#1690)
Add Linux kernel OOM killer control option.

This adds the ability to control the Linux OOM killer oom_score_adj
parameter for all Redis processes, depending on the process role (i.e.
master, replica, background child).

A oom-score-adj global boolean flag control this feature. In addition,
specific values can be configured using oom-score-adj-values if
additional tuning is required.

(cherry picked from commit 70c823a64e800f22ac68f0172acdd1da82d7be32)
2020-09-01 09:27:58 +03:00
Oran Agra
905ffb72e9 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.

(cherry picked from commit 3351549c22434337dfa8a262dce678679a35d7da)
2020-07-20 21:08:26 +03:00
WuYunlong
b6fd631d04 Add missing latency-monitor tcl test to test_helper.tcl. (#6782)
(cherry picked from commit 136e5efeaba3296c79e67a6fe5dc796c0830b61e)
2020-07-20 21:08:26 +03:00
Yossi Gottlieb
6af3d57beb TLS: Add missing redis-cli options. (#7456)
* Tests: fix and reintroduce redis-cli tests.

These tests have been broken and disabled for 10 years now!

* TLS: add remaining redis-cli support.

This adds support for the redis-cli --pipe, --rdb and --replica options
previously unsupported in --tls mode.

* Fix writeConn().

(cherry picked from commit 99b920534f7710d544c38b870fd10c6053283d99)
2020-07-20 21:08:26 +03:00
Oran Agra
8510588213 EXEC always fails with EXECABORT and multi-state is cleared
In order to support the use of multi-exec in pipeline, it is important that
MULTI and EXEC are never rejected and it is easy for the client to know if the
connection is still in multi state.

It was easy to make sure MULTI and DISCARD never fail (done by previous
commits) since these only change the client state and don't do any actual
change in the server, but EXEC is a different story.

Since in the past, it was possible for clients to handle some EXEC errors and
retry the EXEC, we now can't affort to return any error on EXEC other than
EXECABORT, which now carries with it the real reason for the abort too.

Other fixes in this commit:
- Some checks that where performed at the time of queuing need to be re-
  validated when EXEC runs, for instance if the transaction contains writes
  commands, it needs to be aborted. there was one check that was already done
  in execCommand (-READONLY), but other checks where missing: -OOM, -MISCONF,
  -NOREPLICAS, -MASTERDOWN
- When a command is rejected by processCommand it was rejected with addReply,
  which was not recognized as an error in case the bad command came from the
  master. this will enable to count or MONITOR these errors in the future.
- make it easier for tests to create additional (non deferred) clients.
- add tests for the fixes of this commit.

(cherry picked from commit fe8d6fe74920798c146a587810ee91ff049a9093)
2020-07-20 21:08:26 +03:00
antirez
40578433c7 Test: add the tracking unit as default. 2020-05-28 10:22:29 +02:00
Oran Agra
4653d796f0 tests: each test client work on a distinct port range
apparently when running tests in parallel (the default of --clients 16),
there's a chance for two tests to use the same port.
specifically, one test might shutdown a master and still have the
replica up, and then another test will re-use the port number of master
for another master, and then that replica will connect to the master of
the other test.

this can cause a master to count too many full syncs and fail a test if
we run the tests with --single integration/psync2 --loop --stop

see Probmem 2 in #7314
2020-05-28 10:09:51 +02:00
Oran Agra
98e6f2cd5b revive meaningful offset tests 2020-05-28 10:09:51 +02:00
antirez
24a0f7bf55 Remove the PSYNC2 meaningful offset test. 2020-05-28 10:09:51 +02:00
antirez
8134e0b3f1 Test: --dont-clean should do first cleanup. 2020-05-08 10:37:36 +02:00
antirez
d4d2d24745 A few comments and name changes for #7103. 2020-04-17 13:02:40 +02:00
Oran Agra
f37a123687 testsuite run the defrag latency test solo
this test is time sensitive and it sometimes fail to pass below the
latency threshold, even on strong machines.

this test was the reson we're running just 2 parallel tests in the
github actions CI, revering this.
2020-04-17 13:02:40 +02:00
Oran Agra
dcd6726366 diffrent fix for runtest --host --port 2020-04-07 16:52:28 +02:00
antirez
28d402d31b PSYNC2: meaningful offset test. 2020-03-25 15:55:24 +01:00
bodong.ybd
c609bf3f2c Fix bug of tcl test using external server 2020-03-25 15:54:34 +01:00
antirez
2d9a144515 Test engine: better tracking of what workers are doing. 2020-02-27 18:00:47 +01:00
antirez
54237ff024 Test is more complex now, increase default timeout. 2020-02-27 18:00:47 +01:00
Yossi Gottlieb
10ffeb03e4 TLS: Connections refactoring and TLS support.
* Introduce a connection abstraction layer for all socket operations and
integrate it across the code base.
* Provide an optional TLS connections implementation based on OpenSSL.
* Pull a newer version of hiredis with TLS support.
* Tests, redis-cli updates for TLS support.
2019-10-07 21:06:13 +03:00
zhaozhao.zz
1e45354eb6 test cases: skiptill -> skip-till 2019-05-10 16:27:25 +08:00
antirez
d21b3b9d9e Test: disable module testing for now. 2019-04-15 16:50:26 +02:00
Yossi Gottlieb
95881cec60 Add command filter Module API tests. 2019-03-18 19:34:52 +02:00
antirez
9246923436 ACL: Test: add the acl tests as default unit. 2019-01-28 12:12:04 +01:00
antirez
104d7179b6 Test suite: add --loop option.
Very useful with --stop in order to catch heisenbugs.
2018-08-02 19:07:17 +02:00
antirez
0aa7683dbc Test suite: new --stop option.
It pauses the test execution once the first failure is found.
2018-08-02 18:49:49 +02:00
antirez
d76d5e06fa Minor improvements to PR #5187. 2018-07-31 17:30:12 +02:00
Oran Agra
dfdeb6a036 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
chendianqiang
602d502e5c Merge branch 'unstable' into pending-querybuf 2018-07-03 10:07:26 +08:00
WuYunlong
c30b70b3fa fix tests/test_helper.tcl with --wait-server option.
Issue #5063 added --wait-server option, but can not work.
2018-07-02 19:26:52 +08:00
chendianqiang
117a76ac63 limit the size of pending-querybuf in masterclient 2018-07-01 14:43:53 +08:00
Oran Agra
4436bff8a2 test suite infra improvements and fix
* fail the test (exit code) in case of timeout.
* add --wait-server to allow attaching a debugger
* add --dont-clean to keep log files when tests are done
2018-06-26 20:23:55 +03:00
antirez
3d8651911a Test: replication test blocking lists/zsets ops. 2018-05-15 17:33:29 +02:00
Salvatore Sanfilippo
d799fdf733 Merge pull request #4691 from oranagra/active_defrag_v2
Active defrag v2
2018-03-22 09:16:32 +01:00
antirez
b3ae33b2ad CG: test group creation. 2018-03-15 12:54:10 +01:00
Oran Agra
5805907825 Adding real allocator fragmentation to INFO and MEMORY command + active defrag test
other fixes / improvements:
- LUA script memory isn't taken from zmalloc (taken from libc malloc)
  so it can cause high fragmentation ratio to be displayed (which is false)
- there was a problem with "fragmentation" info being calculated from
  RSS and used_memory sampled at different times (now sampling them together)

other details:
- adding a few more allocator info fields to INFO and MEMORY commands
- improve defrag test to measure defrag latency of big keys
- increasing the accuracy of the defrag test (by looking at real grag info)
  this way we can use an even lower threshold and still avoid false positives
- keep the old (total) "fragmentation" field unchanged, but add new ones for spcific things
- add these the MEMORY DOCTOR command
- deduct LUA memory from the rss in case of non jemalloc allocator (one for which we don't "allocator active/used")
- reduce sampling rate of the rss and allocator info
2018-03-12 15:08:52 +02:00
antirez
08b179a719 Streams: basic XADD tests. 2017-12-01 10:24:24 +01:00
antirez
d6380a2453 Regression test for PSYNC2 issue #3899 added.
Experimentally verified that it can trigger the issue reverting the fix.
At least on my system... Being the bug time/backlog dependant, it is
very hard to tell if this test will be able to trigger the problem
consistently, however even if it triggers the problem once in a while,
we'll see it in the CI environment at http://ci.redis.io.
2017-04-28 10:37:07 +02:00
antirez
6c40182042 PSYNC2 test: test added to the default tests. 2016-11-29 10:25:42 +01:00
antirez
14c11b2540 Test: WAIT tests added in wait.tcl unit. 2016-11-18 13:10:29 +01:00
antirez
4e95d8c0a1 Test TOUCH and new TTL / TYPE behavior about object access time. 2016-06-15 17:15:51 +02:00
antirez
7010fc08c8 Test: run GEO tests by default.
Thanks to @oranagra for noticing it was missing.
2016-05-31 16:43:51 +02:00
antirez
33b1f57f32 BITFIELD: overflow fuzzy testing. 2016-03-02 15:16:17 +01:00
antirez
6a3e201234 Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
antirez
c3dbfc8825 Test: fix attach_to_replication_stream to handle newlines. 2015-10-07 22:32:24 +02:00
antirez
d8afd9bc95 Test: stack_logging var should be initialized to 0. 2015-10-01 13:02:25 +02:00
antirez
cdfd6a2607 Test: support for stack logging for OSX malloc/leaks. 2015-10-01 13:02:25 +02:00
antirez
5b562e64a0 Test: split basic unit into string, incr, keyspace units. 2015-02-25 10:33:29 +01:00
antirez
41d0e80ec3 Added regression test for issue #2371. 2015-02-10 14:40:27 +01:00
antirez
820d9dd5cb Test: try to cleanup still running Redis instances on exit.
It's hard to run the Redis test continuously if it leaks processes on
exceptions / errors.
2014-11-28 11:38:17 +01:00
antirez
bf470753ee Test framework: exit on timeout with report.
There was no sane way to detect tests that may never end because of
Redis bugs or tests bugs.
2014-11-28 11:05:58 +01:00
Matt Stancliff
a13ea7e6d4 Spell software correctly 2014-09-29 06:49:07 -04:00