1121 Commits

Author SHA1 Message Date
antirez
1dc952210a Test: regression test for latency expire events logging bug.
Regression for #4452.
2017-11-24 18:33:31 +01:00
Oran Agra
43a17cc78d 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-23 17:15:27 +02:00
antirez
55d48534bb Regression test for issue #4391. 2017-10-30 13:45:46 +01:00
Chris Lamb
b27434b11f Correct spelling of "faield". 2017-08-12 22:21:03 -07:00
antirez
041d783b19 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-03 19:38:31 +02:00
xuzhou
3436bcf681 Fix set with ex/px option when propagated to aof 2017-06-16 17:51:38 +08:00
antirez
08536da477 SLOWLOG: log offending client address and name. 2017-06-15 12:57:54 +02:00
antirez
0c5fd4625a Regression test for #3899 fixed. 2017-04-28 11:16:39 +02: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
ad75edaff9 Defrag: test currently disabled, too many false positives.
Related to #3786.
2017-04-22 15:59:57 +02:00
antirez
e45ecabbff 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:21:41 +02:00
oranagra
a385d0f044 add test for active defrag 2017-04-22 13:17:09 +02:00
antirez
becccdca4f Test: fix, hopefully, false PSYNC failure like in issue #2715.
And many other related Github issues... all reporting the same problem.
There was probably just not enough backlog in certain unlucky runs.
I'll ask people that can reporduce if they see now this as fixed as
well.
2017-04-14 17:53:11 +02:00
Oran Agra
259ae3688f add LFU policies to the test suite, just for coverage 2017-03-15 01:05:15 -07:00
antirez
55a899e67a 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-02-22 13:08:21 +01:00
antirez
907eb97ffc Test: replication-psync, wait more to detect write load.
Slow systems like the original Raspberry PI need more time
than 5 seconds to start the script and detect writes.
After fixing the Raspberry PI can pass the unit without issues.
2017-02-22 12:27:01 +01:00
antirez
334f80df0c Test: fix conditional execution of HINCRBYFLOAT representation test. 2017-02-22 12:00:09 +01:00
antirez
dd144642d1 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 12:22:11 +01:00
antirez
435160dcae Fix test "server is up" detection after logging changes. 2016-12-19 16:49:58 +01:00
antirez
3f037c00f2 Writable slaves expires: unit test. 2016-12-13 16:28:12 +01:00
antirez
e4ee2ac1b7 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:16:46 +01:00
antirez
e4c6e8a710 PSYNC2 test: check ability to resync after restart. 2016-11-29 11:15:16 +01:00
antirez
bda1dd05b9 PSYNC2 test: 20 seconds are enough... 2016-11-29 10:27:53 +01:00
antirez
6c40182042 PSYNC2 test: test added to the default tests. 2016-11-29 10:25:42 +01:00
antirez
4d8362506b PSYNC2 test: modify the test for production. 2016-11-29 10:22:40 +01:00
antirez
c90c479f9e PSYNC2: stop sending newlines to sub-slaves when master is down.
This actually includes two changes:

1) No newlines to take the master-slave link up when the upstream master
is down. Doing this is dangerous because the sub-slave often is received
replication protocol for an half-command, so can't receive newlines
without desyncing the replication link, even with the code in order to
cancel out the bytes that PSYNC2 was using. Moreover this is probably
also not needed/sane, because anyway the slave can keep serving
requests, and because if it's configured to don't serve stale data, it's
a good idea, actually, to break the link.

2) When a +CONTINUE with a different ID is received, we now break
connection with the sub-slaves: they need to be notified as well. This
was part of the original specification but for some reason it was not
implemented in the code, and was alter found as a PSYNC2 bug in the
integration testing.
2016-11-28 17:54:04 +01:00
antirez
a6561f8e30 PSYNC2: Test (WIP).
This is the PSYNC2 test that helped find issues in the code, and that
still can show a protocol desync from time to time. Work is in progress
in order to find the issue. For now the test is not enabled in "make
test" and must be run manually.
2016-11-28 10:13:24 +01:00
antirez
14c11b2540 Test: WAIT tests added in wait.tcl unit. 2016-11-18 13:10:29 +01:00
antirez
9481b398e9 Test: regression test for #3564 added. 2016-10-31 15:46:58 +01:00
antirez
d64b08bb64 Fix SELECT test, broken cause change in error msg. 2016-10-14 15:48:11 +02:00
antirez
8107b61b0d RDB AOF preamble: test it in the aofrw unit. 2016-08-24 15:39:39 +02:00
antirez
23bdeec122 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
16534c5f6f Sentinel: new test unit 07 that tests master down conditions. 2016-07-22 16:39:26 +02:00
antirez
d6332b5034 Sentinel: check Slave INFO state more often when disconnected.
During the initial handshake with the master a slave will report to have
a very high disconnection time from its master (since technically it was
disconnected since forever, so the current UNIX time in seconds is
reported).

However when the slave is connected again the Sentinel may re-scan the
INFO output again only after 10 seconds, which is a long time. During
this time Sentinels will consider this instance unable to failover, so
a useless delay is introduced.

Actaully this hardly happened in the practice because when a slave's
master is down, the INFO period for slaves changes to 1 second. However
when a manual failover is attempted immediately after adding slaves
(like in the case of the Sentinel unit test), this problem may happen.

This commit changes the INFO period to 1 second even in the case the
slave's master is not down, but the slave reported to be disconnected
from the master (by publishing, last time we checked, a master
disconnection time field in INFO).

This change is required as a result of an unrelated change in the
replication code that adds a small delay in the master-slave first
synchronization.
2016-07-22 10:51:25 +02:00
antirez
bf51d7ed15 Regression test for issue #3333. 2016-07-06 11:50:20 +02:00
antirez
d403c08878 Fix test for new RDB checksum failure message. 2016-07-04 12:41:35 +02:00
antirez
a0c8276e16 Test: new randomized stress tester for #3343 alike bugs. 2016-06-28 09:42:20 +02:00
antirez
bb0776971f Stress tester WIP. 2016-06-28 09:33:36 +02:00
antirez
224533b454 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
4e95d8c0a1 Test TOUCH and new TTL / TYPE behavior about object access time. 2016-06-15 17:15:51 +02:00
antirez
df28ab3fce Regression test for #3282. 2016-06-15 11:49:49 +02:00
Pierre Chapuis
08a8ae709b make RPUSHX and LPUSHX variadic 2016-06-05 16:50:24 +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
d31703f3a5 Now that SPOP can be called by scripts use BLPOP on 's' flag test. 2016-05-31 16:43:23 +02:00
antirez
3af352d4ba Test for BITFIELD regression #3221. 2016-05-18 14:53:30 +02:00
antirez
97e1c04f9c Scripting test: match new error message. 2016-05-06 09:12:56 +02:00
antirez
c741cae38c Cluster test 12: reshard back just a few slots to speedup the test. 2016-05-05 11:57:49 +02:00
antirez
10381ae169 Quick fix to avoid false positive in replica migration test. 2016-05-05 09:45:31 +02:00
Salvatore Sanfilippo
8f22e65c39 Merge pull request #3191 from oranagra/minor_fix
Minor fixes found during merge and code review
2016-05-04 09:11:36 +02:00
antirez
14bdb0a42c Cluster regression test for #3043.
The test works but is very slow so far, since it involves resharding
1/5 of all the cluster slots from master 0 to the other 4 masters and
back into the original master.
2016-05-02 18:37:37 +02:00