Commit Graph

5 Commits

Author SHA1 Message Date
Nelson Rodrigues
9013078d40 Fix race condition in JedisSentinelPoolTest
The test was issuing the failover command and only afterwards
connecting to the pub-sub channel to receive failover notifications.
If the failover occurred fast enought the pub-sub listener would never
get the notification.

Run the failover command on a separate Jedis connection after we're
absolutely sure that we're subscribed to the pub-sub channel.
2014-07-28 10:56:21 -07:00
Jungtaek Lim
57b17dcc71 Clean up JedisSentinelTestUtil
* remove all unused methods
* move JedisSentinelPoolTest.waitForJedisSentinelPoolRecognizeNewMaster to JedisSentin
** both JedisSentinelTest and JedisSentinelPoolTest can use this implementation
* introduce FailoverAbortedException
** throws when we subscribe sentinel channels and got message by "-failover-abort-*" c
* respect Source Format to Java Convention (by Eclipse -> Source -> Format)
2014-02-15 13:12:08 +09:00
Jungtaek Lim
a50cf3b15e Apply Sentinel runtime configuration API introduced on Redis 2.8.4
* Implements new sentinel commands (failover, monitor, remove, set) 
* unit test included
** added 2 redis-server and 1 sentinel for failover test
* with some refactoring
** SentinelCommands : refactor to have interface
** HostAndPortUtil : same format to cluster setup
2014-01-22 00:23:40 +09:00
Jonathan Leibiusky
18652b906b Merge branch 'speed-up-unit-test' of github.com:HeartSaVioR/jedis into upgrade_libs
Conflicts:
	src/test/java/redis/clients/jedis/tests/JedisPoolTest.java
	src/test/java/redis/clients/jedis/tests/JedisSentinelPoolTest.java
	src/test/java/redis/clients/jedis/tests/JedisSentinelTest.java
	src/test/java/redis/clients/jedis/tests/ShardedJedisPipelineTest.java
	src/test/java/redis/clients/jedis/tests/ShardedJedisPoolTest.java
	src/test/java/redis/clients/jedis/tests/benchmark/PoolBenchmark.java
	src/test/java/redis/clients/jedis/tests/commands/TransactionCommandsTest.java
2013-11-29 12:12:30 -05:00
Jungtaek Lim
7e1a1a70b2 Speed up Sentinel related tests
* remove FIXME sleep codes for Sentinel related tests
** add functions for Sentinel tests (JedisSentinelTestUtil)
*** waitForSentinelRecognizeRedisReplication
*** waitForNewPromotedMaster
*** waitForSentinelsRecognizeEachOthers
**** TODO: there're no command for sentinel to list recognized sentinel
**** sleep 5.5 sec (sentinel pings to master every 5 sec)

* set HostAndPort class to public(no longer inner) class
** reason: We cannot know pool's current master if HostAndPort class is
private inner class / HostAndPort classes are duplicated (main/test)
** make getter method and parameterized constructor
*** set fields once, get anytime
2013-10-07 11:03:32 +09:00