IT unstability fix - BUG 837 43/6343/2
authorMichal Rehak <mirehak@cisco.com>
Wed, 23 Apr 2014 16:42:25 +0000 (18:42 +0200)
committermichal rehak <mirehak@cisco.com>
Wed, 23 Apr 2014 16:59:37 +0000 (16:59 +0000)
- registration of node by md-sal keeps failing - if closing of connection will wait for 2 secs after handshake, md-sal should succeed in registering

Change-Id: I510defd8bbb7334eaaebc4b066d019b6de2af040
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/ScenarioFactory.java

index 6d0828cf0cdcd4476685e11b2b3158013d00653f..5e05e69bc4fc0e56860698be3fab154e0587b6d8 100644 (file)
@@ -11,6 +11,7 @@ import java.util.Stack;
 
 import org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent;
 import org.opendaylight.openflowjava.protocol.impl.clients.SendEvent;
+import org.opendaylight.openflowjava.protocol.impl.clients.SleepEvent;
 import org.opendaylight.openflowjava.protocol.impl.clients.WaitForMessageEvent;
 import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
 
@@ -52,9 +53,17 @@ public abstract class ScenarioFactory {
                 + "00 01 02 03 01 "
                 + Integer.toHexString(auxId)
                 + " 00 00 00 01 02 03 00 01 02 03")));
+        addSleep(stack);
         return stack;
     }
 
+    /**
+     * @param stack
+     */
+    private static void addSleep(Stack<ClientEvent> stack) {
+        stack.add(0, new SleepEvent(2000));
+    }
+
     /**
      * @param auxId
      * @param pluginVersionBitmap 
@@ -73,6 +82,7 @@ public abstract class ScenarioFactory {
                 + "00 01 02 03 01 "
                 + Integer.toHexString(auxId)
                 + " 00 00 00 01 02 03 00 01 02 03")));
+        addSleep(stack);
         return stack;
     }
 }