BUG-2340 Fix improper cleanup of resources in netconf ssh handler
[controller.git] / opendaylight / commons / protocol-framework / src / test / java / org / opendaylight / protocol / framework / ServerTest.java
index 63026e384c498ce12dca810c94886f9a562215d8..6c4af0186f911a672902a2e7ad941d5791b95938 100644 (file)
@@ -251,7 +251,7 @@ public class ServerTest {
     }
 
     @Test
-    public void testNegotiationFailedNoReconnect() throws Exception {
+    public void testNegotiationFailedReconnect() throws Exception {
         final Promise<Boolean> p = new DefaultPromise<>(GlobalEventExecutor.INSTANCE);
 
         this.dispatcher = getServerDispatcher(p);
@@ -292,8 +292,8 @@ public class ServerTest {
                 });
 
 
-        // Only one strategy should be created for initial connect, no more = no reconnects
-        verify(reconnectStrategyFactory, times(1)).createReconnectStrategy();
+        // Reconnect strategy should be consulted at least twice, for initial connect and reconnect attempts after drop
+        verify(reconnectStrategyFactory, timeout((int) TimeUnit.MINUTES.toMillis(3)).atLeast(2)).createReconnectStrategy();
     }
 
     private SimpleDispatcher getClientDispatcher() {