From 7b3f38ea06998f42ad7e3bed428b6b2eb1271e49 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Wed, 28 Apr 2021 10:15:21 +0200 Subject: Simplify code Add equals and hashcode to JRTConnection Just switch to a new one if current connection is failing Removes need for last sucess, error etc. and healthy status --- .../com/yahoo/config/subscription/impl/JRTConfigRequesterTest.java | 1 - config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'config/src/test') diff --git a/config/src/test/java/com/yahoo/config/subscription/impl/JRTConfigRequesterTest.java b/config/src/test/java/com/yahoo/config/subscription/impl/JRTConfigRequesterTest.java index 4211345dff7..1b56e9290b2 100644 --- a/config/src/test/java/com/yahoo/config/subscription/impl/JRTConfigRequesterTest.java +++ b/config/src/test/java/com/yahoo/config/subscription/impl/JRTConfigRequesterTest.java @@ -277,7 +277,6 @@ public class JRTConfigRequesterTest { } catch (InterruptedException e) { e.printStackTrace(); } - assertTrue(connection.getNumberOfFailovers() >= 1); } private JRTConfigSubscription createSubscription(ConfigSubscriber subscriber, TimingValues timingValues) { diff --git a/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java b/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java index 8bd88d8958f..bfe132c9660 100644 --- a/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java +++ b/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java @@ -139,14 +139,13 @@ public class JRTConnectionPoolTest { JRTConnection secondConnection = failAndGetNewConnection(connectionPool, firstConnection); assertNotEquals(firstConnection, secondConnection); - // Should change connection, , not getting first or seconds connection as new + // Should change connection, not getting second connection as new JRTConnection thirdConnection = failAndGetNewConnection(connectionPool, secondConnection); // Fail a few more times with old connection, as will happen when there are multiple subscribers // Connection should not change assertEquals(thirdConnection, failAndGetNewConnection(connectionPool, secondConnection)); assertEquals(thirdConnection, failAndGetNewConnection(connectionPool, secondConnection)); assertEquals(thirdConnection, failAndGetNewConnection(connectionPool, secondConnection)); - assertNotEquals(firstConnection, thirdConnection); assertNotEquals(secondConnection, thirdConnection); // Should change connection, not getting third connection as new -- cgit v1.2.3