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:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user