From 87a1d5b2e8531d1b3a646ecb4f8a63a0b1eef6cd Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Wed, 15 Dec 2021 10:23:04 +0300 Subject: [PATCH] tests fixed --- .../src/test/java/org/redisson/RedissonTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/redisson/src/test/java/org/redisson/RedissonTest.java b/redisson/src/test/java/org/redisson/RedissonTest.java index 65128d6bc..a469406d6 100644 --- a/redisson/src/test/java/org/redisson/RedissonTest.java +++ b/redisson/src/test/java/org/redisson/RedissonTest.java @@ -422,7 +422,6 @@ public class RedissonTest extends BaseTest { for (RFuture rFuture : futures) { rFuture.awaitUninterruptibly(); if (!rFuture.isSuccess()) { - System.out.println("cause " + rFuture.cause()); if (rFuture.cause().getMessage().contains("READONLY You can't write against")) { readonlyErrors++; } @@ -433,8 +432,9 @@ public class RedissonTest extends BaseTest { } System.out.println("errors " + errors + " success " + success + " readonly " + readonlyErrors); - - assertThat(errors).isLessThan(1300); + + assertThat(futures.get(futures.size() - 1).isSuccess()).isTrue(); + assertThat(errors).isLessThan(820); assertThat(readonlyErrors).isZero(); redisson.shutdown(); @@ -736,8 +736,9 @@ public class RedissonTest extends BaseTest { process.shutdown(); assertThat(readonlyErrors).isZero(); - assertThat(errors).isLessThan(130); - assertThat(success).isGreaterThan(600 - 130); + assertThat(errors).isLessThan(200); + assertThat(success).isGreaterThan(600 - 200); + assertThat(futures.get(futures.size() - 1).isSuccess()).isTrue(); } @@ -1114,7 +1115,9 @@ public class RedissonTest extends BaseTest { public void testMasterSlaveConnectionFail() { Assertions.assertThrows(RedisConnectionException.class, () -> { Config config = new Config(); - config.useMasterSlaveServers().setMasterAddress("redis://127.99.0.1:1111"); + config.useMasterSlaveServers() + .setMasterAddress("redis://127.99.0.1:1111") + .addSlaveAddress("redis://127.99.0.2:1111"); Redisson.create(config); Thread.sleep(1500);