Fix ControlCommandsTest to don't hang from monitor test because of timing issue

* In monitor command test, input thread waits for monitor thread to monitor
** Monitor command test sometimes hang when input thread run earlier than monitor thread.
This commit is contained in:
Jungtaek Lim
2014-01-27 12:47:21 +09:00
parent 01842e4731
commit 642cec66d5

View File

@@ -61,6 +61,11 @@ public class ControlCommandsTest extends JedisCommandTestBase {
public void monitor() {
new Thread(new Runnable() {
public void run() {
try {
// sleep 100ms to make sure that monitor thread runs first
Thread.sleep(100);
} catch (InterruptedException e) {
}
Jedis j = new Jedis("localhost");
j.auth("foobared");
for (int i = 0; i < 5; i++) {