Commit Graph

423 Commits

Author SHA1 Message Date
Guy Benoish
e16402b0c8 Don't call sdscmp() with shared.maxstring or shared.minstring 2018-12-11 18:04:48 +01:00
antirez
549409ffa5 Test: MIGRATE AUTH test added.
Related to #2507.
2018-01-09 18:49:45 +01:00
antirez
f30454c1f6 Test: regression test for latency expire events logging bug.
Regression for #4452.
2017-11-27 12:32:41 +01:00
Oran Agra
d01f163ce0 fix string to double conversion, stopped parsing on \0 even if the string has more data.
getLongLongFromObject calls string2ll which has this line:
/* Return if not all bytes were used. */
so if you pass an sds with 3 characters "1\01" it will fail.

but getLongDoubleFromObject calls strtold, and considers it ok if eptr[0]==`\0`
i.e. if the end of the string found by strtold ends with null terminator

127.0.0.1:6379> set a 1
OK
127.0.0.1:6379> setrange a 2 2
(integer) 3
127.0.0.1:6379> get a
"1\x002"
127.0.0.1:6379> incrbyfloat a 2
"3"
127.0.0.1:6379> get a
"3"
2017-11-24 09:00:37 +01:00
antirez
b25c245156 Regression test for issue #4391. 2017-10-30 13:46:11 +01:00
antirez
eeb905713b Fix GEORADIUS edge case with huge radius.
This commit closes issue #3698, at least for now, since the root cause
was not fixed: the bounding box function, for huge radiuses, does not
return a correct bounding box, there are points still within the radius
that are left outside.

So when using GEORADIUS queries with radiuses in the order of 5000 km or
more, it was possible to see, at the edge of the area, certain points
not correctly reported.

Because the bounding box for now was used just as an optimization, and
such huge radiuses are not common, for now the optimization is just
switched off when the radius is near such magnitude.

Three test cases found by the Continuous Integration test were added, so
that we can easily trigger the bug again, both for regression testing
and in order to properly fix it as some point in the future.
2017-07-06 16:09:41 +02:00
xuzhou
63e1c9f224 Fix set with ex/px option when propagated to aof 2017-06-22 11:01:27 +02:00
antirez
0b7ba621b7 SLOWLOG: log offending client address and name. 2017-06-15 17:02:16 +02:00
antirez
8c4b0f411f Defrag: test currently disabled, too many false positives.
Related to #3786.
2017-04-22 16:00:16 +02:00
antirez
51b12ed1b5 Defrag: fix test false positive.
Apparently 1.4 is too low compared to what you get in certain setups
(including mine). I raised it to 1.55 that hopefully is still enough to
test that the fragmentation went down from 1.7 but without incurring in
issues, however the test setup may be still fragile so certain times this
may lead to false positives again, it's hard to test for these things
in a determinsitic way.

Related to #3786.
2017-04-22 13:23:27 +02:00
oranagra
94a7090705 add test for active defrag 2017-04-22 13:16:01 +02:00
Oran Agra
8aced9e9c5 add LFU policies to the test suite, just for coverage 2017-03-22 10:14:36 +01:00
antirez
1552058881 Solaris fixes about tail usage and atomic vars.
Testing with Solaris C compiler (SunOS 5.11 11.2 sun4v sparc sun4v)
there were issues compiling due to atomicvar.h and running the
tests also failed because of "tail" usage not conform with Solaris
tail implementation. This commit fixes both the issues.
2017-03-22 10:07:00 +01:00
antirez
b3440b3559 Test: fix conditional execution of HINCRBYFLOAT representation test. 2017-03-22 10:06:44 +01:00
antirez
f3add0692f Geo: fuzzy test inconsistency report fixed to show all points.
We need to report all the points added into the set, not just the ones
matching the Tcl distance algo.
2016-12-20 13:33:46 +01:00
antirez
41994f2213 Geo: improve fuzz test.
The test now uses more diverse radius sizes, especially sizes near or
greater the whole earth surface are used, that are known to trigger edge
cases. Moreover the PRNG seeding was probably resulting into the same
sequence tested over and over again, now seeding unsing the current unix
time in milliseconds.

Related to #3631.
2016-12-05 14:19:11 +01:00
antirez
f115461f4e Test: WAIT tests added in wait.tcl unit. 2016-11-18 13:10:29 +01:00
antirez
9749e96f42 Test: regression test for #3564 added. 2016-10-31 15:46:58 +01:00
antirez
f633212073 Fix SELECT test, broken cause change in error msg. 2016-10-14 15:48:11 +02:00
antirez
dacb69ed00 RDB AOF preamble: test it in the aofrw unit. 2016-08-24 15:39:39 +02:00
antirez
356a6304ec Multiple GEORADIUS bugs fixed.
By grepping the continuous integration errors log a number of GEORADIUS
tests failures were detected.

Fortunately when a GEORADIUS failure happens, the test suite logs enough
information in order to reproduce the problem: the PRNG seed,
coordinates and radius of the query.

By reproducing the issues, three different bugs were discovered and
fixed in this commit. This commit also improves the already good
reporting of the fuzzer and adds the failure vectors as regression
tests.

The issues found:

1. We need larger squares around the poles in order to cover the area
requested by the user. There were already checks in order to use a
smaller step (larger squares) but the limit set (+/- 67 degrees) is not
enough in certain edge cases, so 66 is used now.

2. Even near the equator, when the search area center is very near the
edge of the square, the north, south, west or ovest square may not be
able to fully cover the specified radius. Now a test is performed at the
edge of the initial guessed search area, and larger squares are used in
case the test fails.

3. Because of rounding errors between Redis and Tcl, sometimes the test
signaled false positives. This is now addressed.

Whenever possible the original code was improved a bit in other ways. A
debugging example stanza was added in order to make the next debugging
session simpler when the next bug is found.
2016-07-27 11:34:25 +02:00
antirez
abb3385e8d Regression test for issue #3333. 2016-07-06 11:50:20 +02:00
antirez
24bd9b19f6 Test: new randomized stress tester for #3343 alike bugs. 2016-06-28 09:42:20 +02:00
antirez
f983318e52 Stress tester WIP. 2016-06-28 09:33:36 +02:00
antirez
49899866c8 Regression test for issue #3343 exact min crash sequence.
Note: it was verified that it can crash the test suite without the patch
applied.
2016-06-28 09:27:14 +02:00
antirez
3bd20ea2f1 Test TOUCH and new TTL / TYPE behavior about object access time. 2016-06-15 17:15:51 +02:00
antirez
212f157855 Regression test for #3282. 2016-06-15 11:49:49 +02:00
Pierre Chapuis
d88c3c77be make RPUSHX and LPUSHX variadic 2016-06-05 16:50:24 +02:00
antirez
231c9db1b5 Now that SPOP can be called by scripts use BLPOP on 's' flag test. 2016-05-31 16:43:23 +02:00
antirez
078f46126c Test for BITFIELD regression #3221. 2016-05-18 14:53:30 +02:00
antirez
f9ee039a76 Scripting test: match new error message. 2016-05-06 09:12:56 +02:00
Oran Agra
5e3880a492 various cleanups and minor fixes 2016-04-25 16:49:57 +03:00
Damian Janowski
0b4bb502a2 Fix ZINCRBY return value. 2016-04-18 00:35:54 -03:00
antirez
28c291c55c BITFIELD: overflow wrap behavior fuzz tester. 2016-03-02 17:22:42 +01:00
antirez
ae7317e8e9 BITFIELD basic unit tests. 2016-03-02 16:31:02 +01:00
antirez
9a00da0d14 BITFIELD: overflow fuzzy testing. 2016-03-02 15:16:17 +01:00
antirez
27fc01a7b8 Fix typo in bitops.tcl comment. 2016-03-02 15:14:59 +01:00
antirez
f4befcc0ff GEOADD STORE/STOREDIST tests. 2016-02-18 14:42:42 +01:00
Salvatore Sanfilippo
8637384191 Merge pull request #2726 from seppo0010/patch-2
Fix race condition in unit/introspection
2016-01-15 16:24:06 +01:00
antirez
f43c794b0b Scripting: handle trailing comments.
This fix, provided by Paul Kulchenko (@pkulchenko), allows the Lua
scripting engine to evaluate statements with a trailing comment like the
following one:

    EVAL "print() --comment" 0

Lua can't parse the above if the string does not end with a newline, so
now a final newline is always added automatically. This does not change
the SHA1 of scripts since the SHA1 is computed on the body we pass to
EVAL, without the other code we add to register the function.

Close #2951.
2016-01-08 15:44:21 +01:00
antirez
82fd74a118 MIGRATE: test more corner cases. 2015-12-11 14:27:08 +01:00
antirez
29d680ed5a Test: pipelined MIGRATE tests added. 2015-12-11 13:41:58 +01:00
antirez
fceaa46dda Test HINCRBYFLOAT rounding only in x86_64 and when valgrind is not in use.
64 bit double math is not enough to make the test passing, and rounding
to 1.2999999 instead of 1.23 is not an error in the implementation.
Valgrind and sometimes other archs are not able to work with 80 bit
doubles.
2015-11-28 09:28:37 +01:00
antirez
f6255703b0 Add regression test for HINCRBYFLOAT formatting change.
This test was kindly provided by Jan-Erik Rediger (@badboy here on
Github) that discovered the issue.

See issue #2846.
2015-11-04 17:02:34 +01:00
antirez
30b324698f Test: improve PFCOUNT with multiple keys testing.
An user raised a question about a given behavior of PFCOUNT. Added a
test to show the behavior (union) is correct when most of the items are
in common.
2015-11-03 19:03:17 +01:00
antirez
5b63ae37ff Scripting: commands replication tests. 2015-10-30 12:06:09 +01:00
antirez
073a42b997 Scripting: execute tests with command replication as well. 2015-10-30 12:06:09 +01:00
antirez
eda06b51fb Scripting: test Redis provided Lua functions error reporting. 2015-10-30 12:06:09 +01:00
antirez
6ddcba6ec9 Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
antirez
ceaf58dfd5 Regression test for GEORADIUS COUNT arity check. 2015-10-06 09:27:29 +02:00