BUG-837: it unstable (timeout to 60s) 43/17043/1
authorMichal Rehak <mirehak@cisco.com>
Tue, 24 Mar 2015 10:00:26 +0000 (11:00 +0100)
committerMichal Rehak <mirehak@cisco.com>
Tue, 24 Mar 2015 10:00:26 +0000 (11:00 +0100)
 - changed timeout for resolving services to 60s

Change-Id: I8b9796f22cd5bdaef580875c6ff3661b26e99130
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflowplugin-it/pom.xml
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java
openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java
pom.xml

index 587001410b2983bcb84a48d7de6fc01f9e7e669b..f1aba0f667b257337a66d6cdca3e26dffaa7d047 100644 (file)
@@ -9,10 +9,6 @@
 
     <artifactId>openflowplugin-it</artifactId>
 
-    <properties>
-        <exam.version>3.0.0</exam.version>
-    </properties>
-
     <build>
         <plugins>
             <plugin>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam-junit4</artifactId>
-            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam-link-mvn</artifactId>
-            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam</artifactId>
-            <version>${exam.version}</version>
         </dependency>
         <dependency>
             <groupId>equinoxSDK381</groupId>
           <artifactId>config-persister-file-xml-adapter</artifactId>
           <scope>test</scope>
         </dependency>
-        
+
         <dependency>
           <groupId>org.openexi</groupId>
           <artifactId>nagasena</artifactId>
             <scope>test</scope>
             <version>${project.version}</version>
         </dependency>
-        
+
         <dependency>
             <groupId>commons-codec</groupId>
             <artifactId>commons-codec</artifactId>
index 4a844a9f7a227ad3eb75a3776da3a5989ee3c617..60a8002bf60ae2cb53e228dd2928a1614ef71f76 100644 (file)
@@ -104,18 +104,18 @@ public class OFPluginFlowTest {
 
     private static final ArrayBlockingQueue<Runnable> SCENARIO_POOL_QUEUE = new ArrayBlockingQueue<>(1);
 
-    @Inject @Filter(timeout=20000)
+    @Inject @Filter(timeout=60000)
     OpenflowPluginProvider openflowPluginProvider;
 
-    @Inject
+    @Inject @Filter(timeout=60000)
     BundleContext ctx;
-    
-    @Inject @Filter(timeout=20000)
+
+    @Inject @Filter(timeout=60000)
     static DataBroker dataBroker;
-    @Inject @Filter(timeout=20000)
+
+    @Inject @Filter(timeout=60000)
     NotificationProviderService notificationService;
-    
+
     private SimpleClient switchSim;
     private ThreadPoolLoggingExecutor scenarioPool;
 
@@ -182,7 +182,7 @@ public class OFPluginFlowTest {
             }
         }
     }
-    
+
     /**
      * test basic integration with OFLib running the handshake
      * @throws Exception
@@ -191,10 +191,10 @@ public class OFPluginFlowTest {
     public void testFlowMod() throws Exception {
         LOG.debug("testFlowMod integration test");
         TriggerTestListener brmListener = new TriggerTestListener();
-        
+
         dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
                 getWildcardPath(), brmListener, DataChangeScope.BASE);
-        
+
         switchSim = createSimpleClient();
         switchSim.setSecuredClient(false);
         Deque<ClientEvent> handshakeScenario = ScenarioFactory.createHandshakeScenarioVBM(
@@ -256,13 +256,13 @@ public class OFPluginFlowTest {
 
                 OFPaxOptionsAssistant.ofPluginBundles());
     }
-    
+
     static FlowBuilder createTestFlow() {
         short tableId = 0;
         FlowBuilder flow = new FlowBuilder();
         flow.setMatch(createMatch1().build());
         flow.setInstructions(createDecNwTtlInstructions().build());
-        
+
         FlowId flowId = new FlowId("127");
         FlowKey key = new FlowKey(flowId);
         if (null == flow.isBarrier()) {
@@ -282,10 +282,10 @@ public class OFPluginFlowTest {
 
         flow.setKey(key);
         flow.setFlowName("Foo" + "X" + "f1");
-        
+
         return flow;
     }
-    
+
     private static MatchBuilder createMatch1() {
         MatchBuilder match = new MatchBuilder();
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
@@ -301,7 +301,7 @@ public class OFPluginFlowTest {
         match.setEthernetMatch(eth.build());
         return match;
     }
-    
+
     private static InstructionsBuilder createDecNwTtlInstructions() {
         DecNwTtlBuilder ta = new DecNwTtlBuilder();
         DecNwTtl decNwTtl = ta.build();
@@ -330,8 +330,8 @@ public class OFPluginFlowTest {
         isb.setInstruction(instructions);
         return isb;
     }
-    
-    static void writeFlow(FlowBuilder flow, InstanceIdentifier<FlowCapableNode> flowNodeIdent) { 
+
+    static void writeFlow(FlowBuilder flow, InstanceIdentifier<FlowCapableNode> flowNodeIdent) {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         final InstanceIdentifier<Flow> path1 = flowNodeIdent.child(Table.class, new TableKey(flow.getTableId()))
                 .child(Flow.class, flow.getKey());
@@ -349,14 +349,14 @@ public class OFPluginFlowTest {
             }
         });
     }
-    
+
     //TODO move to separate test util class
     private final static Flow readFlow(InstanceIdentifier<Flow> flow) {
         Flow searchedFlow = null;
         ReadTransaction rt = dataBroker.newReadOnlyTransaction();
         CheckedFuture<Optional<Flow>, ReadFailedException> flowFuture =
             rt.read(LogicalDatastoreType.CONFIGURATION, flow);
-        
+
         try {
           Optional<Flow> maybeFlow = flowFuture.checkedGet(500, TimeUnit.SECONDS);
           if(maybeFlow.isPresent()) {
@@ -367,7 +367,7 @@ public class OFPluginFlowTest {
         } catch (ReadFailedException e) {
           LOG.error("Something wrong happened in DataStore. Getting FLOW for userId {} failed.", e);
         }
-        
+
         return searchedFlow;
     }
 }
index 4716856fecd1b6288ed3d0d43b4b7b8fa1c0f710..a565e7a4fc8e9622721d8c4edd65a5ef490b45a8 100644 (file)
@@ -49,10 +49,10 @@ public class OFPluginToLibraryTest {
 
     private final ArrayBlockingQueue<Runnable> SCENARIO_POOL_QUEUE = new ArrayBlockingQueue<>(1);
 
-    @Inject @Filter(timeout=20000)
+    @Inject @Filter(timeout=60000)
     OpenflowPluginProvider openflowPluginProvider;
 
-    @Inject
+    @Inject @Filter(timeout=60000)
     BundleContext ctx;
 
     private SimpleClient switchSim;
index 1b1ab7c7886ebd4fccff714899bd3b8dc08202d2..9f9b41e23e565d464a43f97dd1f4a0e67cc548a8 100644 (file)
@@ -40,6 +40,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Openday
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
 import org.ops4j.pax.exam.util.Filter;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
@@ -49,6 +51,7 @@ import org.slf4j.LoggerFactory;
  * Exercise inventory listener ({@link OpendaylightInventoryListener#onNodeUpdated(NodeUpdated)})
  */
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
 public class SalIntegrationTest {
 
     static final Logger LOG = LoggerFactory.getLogger(SalIntegrationTest.class);
@@ -57,16 +60,14 @@ public class SalIntegrationTest {
     private ThreadPoolLoggingExecutor scenarioPool;
     private SimpleClient switchSim;
     private Runnable finalCheck;
-    
-    @Inject
+
+    @Inject @Filter(timeout=60*000)
     BundleContext ctx;
 
-    @Inject
-    @Filter(timeout=20*1000)
+    @Inject @Filter(timeout=60*1000)
     BindingAwareBroker broker;
-    
-    @Inject 
-    @Filter(timeout=20*1000)
+
+    @Inject @Filter(timeout=60*1000)
     OpenflowPluginProvider openflowPluginProvider;
 
     /**
@@ -75,7 +76,7 @@ public class SalIntegrationTest {
     static long getFailSafeTimeout() {
         return 30000;
     }
-    
+
     /**
      * test setup
      * @throws InterruptedException
@@ -93,7 +94,7 @@ public class SalIntegrationTest {
     public void tearDown() {
         SimulatorAssistant.waitForSwitchSimulatorOn(switchSim);
         SimulatorAssistant.tearDownSwitchSimulatorAfterScenario(switchSim, scenarioPool, getFailSafeTimeout());
-        
+
         if (finalCheck != null) {
             LOG.info("starting final check");
             finalCheck.run();
@@ -118,7 +119,7 @@ public class SalIntegrationTest {
         };
         ConsumerContext consumerReg = broker.registerConsumer(openflowConsumer, ctx);
         assertNotNull(consumerReg);
-        
+
         LOG.debug("handshake integration test");
         LOG.debug("openflowPluginProvider: " + openflowPluginProvider);
 
@@ -145,9 +146,9 @@ public class SalIntegrationTest {
         return options(systemProperty("osgi.console").value("2401"),
                 OFPaxOptionsAssistant.osgiConsoleBundles(),
                 OFPaxOptionsAssistant.loggingBudles(),
-                
+
                 TestHelper.junitAndMockitoBundles(),
-                TestHelper.mdSalCoreBundles(), 
+                TestHelper.mdSalCoreBundles(),
                 TestHelper.configMinumumBundles(),
                 TestHelper.baseModelBundles(),
                 OFPaxOptionsAssistant.ofLibraryBundles(),
diff --git a/pom.xml b/pom.xml
index aa6d6462d9bda190b343a73ae57d395c54f46930..1a8abca45925785e629c5c3f96fa2509962fe1ed 100644 (file)
--- a/pom.xml
+++ b/pom.xml
           <artifactId>sal-binding-broker-impl</artifactId>
           <version>${sal.binding.api.version}</version>
 
-          <!-- excluding old models pulled as transient dependencies 
+          <!-- excluding old models pulled as transient dependencies
                TODO: remove -->
           <exclusions>
             <exclusion>
               </configuration>
             </plugin>
             <plugin>
-              <groupId>org.ops4j.pax.exam</groupId>
-              <artifactId>maven-paxexam-plugin</artifactId>
-              <version>1.2.4</version>
-            </plugin>
-          <plugin>
               <artifactId>maven-clean-plugin</artifactId>
               <configuration>
                   <filesets>