520 Commits

Author SHA1 Message Date
antirez
822c911566 Test: check sorted set elements order after union.
This is not a regression but issue #1786 showed the need for this test.
2014-07-22 17:52:04 +02:00
antirez
5926e0164e Test: Pub/Sub PING. 2014-07-18 12:03:31 +02:00
antirez
65cca8c9bb Test: small integer sharing depends on maxmemory policy. 2014-07-18 10:55:08 +02:00
antirez
efe07ffa3a Test: more reliable AOF rewrite test under write load. 2014-07-10 16:42:43 +02:00
antirez
6f52d71a21 LATENCY command / monitor basic tests. 2014-07-10 16:23:54 +02:00
antirez
383536119d Test: AOF rewrite during write load. 2014-07-10 11:25:12 +02:00
antirez
45c507b0bd Test: use higher level redis.tcl proc to read replies. 2014-06-18 16:25:53 +02:00
antirez
f7df4e9674 Scripting: regression test for issue #1811. 2014-06-12 16:20:30 +02:00
antirez
ec2fd7bbc1 Fix semantics of Lua calls to SELECT.
Lua scripts are executed in the context of the currently selected
database (as selected by the caller of the script).

However Lua scripts are also free to use the SELECT command in order to
affect other DBs. When SELECT is called frm Lua, the old behavior, before
this commit, was to automatically set the Lua caller selected DB to the
last DB selected by Lua. See for example the following sequence of
commands:

    SELECT 0
    SET x 10
    EVAL "redis.call('select','1')" 0
    SET x 20

Before this commit after the execution of this sequence of commands,
we'll have x=10 in DB 0, and x=20 in DB 1.

Because of the problem above, there was a bug affecting replication of
Lua scripts, because of the actual implementation of replication. It was
possible to fix the implementation of Lua scripts in order to fix the
issue, but looking closely, the bug is the consequence of the behavior
of Lua ability to set the caller's DB.

Under the old semantics, a script selecting a different DB, has no simple
ways to restore the state and select back the previously selected DB.
Moreover the script auhtor must remember that the restore is needed,
otherwise the new commands executed by the caller, will be executed in
the context of a different DB.

So this commit fixes both the replication issue, and this hard-to-use
semantics, by removing the ability of Lua, after the script execution,
to force the caller to switch to the DB selected by the Lua script.

The new behavior of the previous sequence of commadns is to just set
X=20 in DB 0. However Lua scripts are still capable of writing / reading
from different DBs if needed.

WARNING: This is a semantical change that will break programs that are
conceived to select the client selected DB via Lua scripts.

This fixes issue #1811.
2014-06-12 16:05:52 +02:00
Matt Stancliff
5a61117448 Scripting: Fix regression from #1118
The new check-for-number behavior of Lua arguments broke
users who use large strings of just integers.

The Lua number check would convert the string to a number, but
that breaks user data because
Lua numbers have limited precision compared to an arbitrarily
precise number wrapped in a string.

Regression fixed and new test added.

Fixes #1118 again.
2014-06-10 14:26:13 -04:00
Salvatore Sanfilippo
a26294f23e Merge pull request #1669 from mattsta/blpop-internally-added-keys
Fix blocking operations from missing new lists
2014-06-09 11:37:28 +02:00
Salvatore Sanfilippo
75bd4b261c Merge pull request #1789 from yoav-steinberg/fix_eval_in_tests
Fix eval usage in tests to conform with eval semantics
2014-06-06 10:37:57 +02:00
antirez
b4385aeec0 Regression test for issue #1118. 2014-06-04 18:51:20 +02:00
antirez
170a7dc749 Test: dump.tcl fixed for RESTORE new error msg. 2014-05-22 15:56:17 +02:00
Matt Stancliff
c5b960f5a0 Fix blocking operations from missing new lists
Behrad Zari discovered [1] and Josiah reported [2]: if you block
and wait for a list to exist, but the list creates from
a non-push command, the blocked client never gets notified.

This commit adds notification of blocked clients into
the DB layer and away from individual commands.

Lists can be created by [LR]PUSH, SORT..STORE, RENAME, MOVE,
and RESTORE.  Previously, blocked client notifications were
only triggered by [LR]PUSH.  Your client would never get
notified if a list were created by SORT..STORE or RENAME or
a RESTORE, etc.

Blocked client notification now happens in one unified place:
  - dbAdd() triggers notification when adding a list to the DB

Two new tests are added that fail prior to this commit.

All test pass.

Fixes #1668

[1]: https://groups.google.com/forum/#!topic/redis-db/k4oWfMkN1NU
[2]: #1668
2014-05-21 09:52:52 -04:00
antirez
7cc1e6c7a8 Regression test for issue #1764. 2014-05-20 16:20:16 +02:00
antirez
a1f9154dbf HyperLogLog regression test for issue #1762. 2014-05-19 15:44:04 +02:00
antirez
6e41e9f596 Scripting test: check that Lua can call commands rewirting argv.
SPOP, tested in the new test, is among the commands rewritng the
client->argv argument vector (it gets rewritten as SREM) for command
replication purposes.

Because of recent optimizations to client->argv caching in the context
of the Lua internal Redis client, it is important to test for SPOP to be
callable from Lua without bad effects to the other commands.
2014-05-07 16:12:32 +02:00
antirez
ba46f66826 Test: fixed scripting.tcl test false positive. 2014-04-24 21:44:32 +02:00
Salvatore Sanfilippo
d7a561fbc7 Merge pull request #1677 from mattsta/expire-before-delete
Check key expiration before deleting
2014-04-23 16:13:49 +02:00
yoav
c8adbd0799 Merge remote-tracking branch 'upstream/unstable' into unstable 2014-04-22 10:01:21 +03:00
antirez
ed2cc684ab Fuzzy test for ZREMRANGEBYLEX added. 2014-04-18 13:02:16 +02:00
antirez
531fbda313 PFCOUNT multi-key test added. 2014-04-18 12:36:33 +02:00
antirez
00e9dc8b75 Sorted set lex ranges stress tester. 2014-04-17 10:25:58 +02:00
antirez
cd35352677 Basic ZRANGEBYLEX / ZLEXCOUNT tests. 2014-04-17 00:08:11 +02:00
antirez
20d49e3ac9 More HyperLogLog tests. 2014-04-16 09:17:38 +02:00
antirez
cd73060972 PFMERGE fixed to work with sparse encoding. 2014-04-14 16:09:32 +02:00
Matt Stancliff
daba106237 Add test for deleting an expired key
Verify proper expire-before-delete behavior.

This test passes with the expire-before-delete commit and fails
without it.
2014-04-10 18:32:19 -04:00
yoav
9af8168552 Fix eval usage in tests to conform with eval semantics 2014-04-06 17:20:01 +03:00
antirez
038f6c8221 Initial HyperLogLog tests. 2014-04-03 22:16:05 +02:00
antirez
4aa6b6e9b8 BITPOS fuzzy testing. 2014-02-27 15:27:05 +01:00
antirez
0348a8c1f8 Basic BITPOS tests. 2014-02-27 15:01:45 +01:00
antirez
411d930529 Added two more BITCOUNT tests stressing misaligned access. 2014-02-27 10:07:29 +01:00
antirez
ef3d34c345 BITCOUNT fuzzy test with random start/end added.
It was verified in practice that this test is able to stress much more
the implementation by introducing errors that were only trivially to
detect with different offsets but impossible to detect starting always
at zero and counting bits the full length of the string.
2014-02-27 10:00:17 +01:00
antirez
c0e261e37c Test: regression for issue #1549.
It was verified that reverting the commit that fixes the bug, the test
no longer passes.
2014-02-13 12:26:38 +01:00
antirez
e9786a3255 Test: regression for issues #1483. 2014-01-09 11:19:03 +01:00
antirez
088a617c61 Test: stress events flags to/from string conversion. 2014-01-08 17:18:30 +01:00
antirez
f71de5ab4e SDIFF iterator misuse bug regression test added.
See commit 69a3303 for more info about the bug.
2013-12-13 11:37:13 +01:00
Yossi Gottlieb
834a5f530d Return proper error on requests with an unbalanced number of quotes. 2013-12-08 12:58:12 +02:00
antirez
8bc3e626a5 Fix false positive in memory efficiency test.
Fixes issue #1298.
2013-11-25 10:21:46 +01:00
antirez
7dfcfe47b6 Added tests for [SHZ]SCAN with MATCH. 2013-11-05 15:19:44 +01:00
antirez
adcc1fc04d SSCAN with integer encoded object test improved. 2013-10-31 10:37:27 +01:00
antirez
4f3d9c0595 Regression test added for [SHZ]SCAN issue #1354. 2013-10-31 09:43:21 +01:00
antirez
996bffbfb6 Test: added a SCAN test trying to trigger HT resize. 2013-10-30 16:50:25 +01:00
antirez
cde7c072ba Test: added ZSCAN test. 2013-10-30 16:25:53 +01:00
antirez
82dcd85503 Test: added HSCAN test. 2013-10-30 16:24:39 +01:00
antirez
35250fa9df Test: added SSCAN test. 2013-10-30 11:58:04 +01:00
antirez
a23bf27718 SCAN test keys sorting turned into more idiomatic Tcl. 2013-10-30 11:36:12 +01:00
antirez
d1bdb17b42 SCAN: tests moved to unit/scan.tcl. 2013-10-30 11:34:01 +01:00
antirez
b18ac5f574 SCAN: Fix test after option renamed from PATTERN to MATCH. 2013-10-25 11:55:28 +02:00