From 8b4d47df9e5ece7069ff6195cc4bd2d833c4b438 Mon Sep 17 00:00:00 2001 From: Michal Rehak Date: Tue, 24 Mar 2015 11:00:26 +0100 Subject: [PATCH] BUG-837: it unstable (timeout to 60s) - changed timeout for resolving services to 60s Change-Id: I8b9796f22cd5bdaef580875c6ff3661b26e99130 Signed-off-by: Michal Rehak --- openflowplugin-it/pom.xml | 11 +---- .../openflow/md/it/OFPluginFlowTest.java | 40 +++++++++---------- .../openflow/md/it/OFPluginToLibraryTest.java | 4 +- .../openflow/md/it/SalIntegrationTest.java | 25 ++++++------ pom.xml | 7 +--- 5 files changed, 38 insertions(+), 49 deletions(-) diff --git a/openflowplugin-it/pom.xml b/openflowplugin-it/pom.xml index 587001410b..f1aba0f667 100644 --- a/openflowplugin-it/pom.xml +++ b/openflowplugin-it/pom.xml @@ -9,10 +9,6 @@ openflowplugin-it - - 3.0.0 - - @@ -138,19 +134,16 @@ org.ops4j.pax.exam pax-exam-junit4 - ${exam.version} test org.ops4j.pax.exam pax-exam-link-mvn - ${exam.version} test org.ops4j.pax.exam pax-exam - ${exam.version} equinoxSDK381 @@ -217,7 +210,7 @@ config-persister-file-xml-adapter test - + org.openexi nagasena @@ -267,7 +260,7 @@ test ${project.version} - + commons-codec commons-codec diff --git a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java index 4a844a9f7a..60a8002bf6 100644 --- a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java +++ b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginFlowTest.java @@ -104,18 +104,18 @@ public class OFPluginFlowTest { private static final ArrayBlockingQueue 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 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 flowNodeIdent) { + + static void writeFlow(FlowBuilder flow, InstanceIdentifier flowNodeIdent) { ReadWriteTransaction modification = dataBroker.newReadWriteTransaction(); final InstanceIdentifier 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 searchedFlow = null; ReadTransaction rt = dataBroker.newReadOnlyTransaction(); CheckedFuture, ReadFailedException> flowFuture = rt.read(LogicalDatastoreType.CONFIGURATION, flow); - + try { Optional 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; } } diff --git a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java index 4716856fec..a565e7a4fc 100644 --- a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java +++ b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/OFPluginToLibraryTest.java @@ -49,10 +49,10 @@ public class OFPluginToLibraryTest { private final ArrayBlockingQueue 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; diff --git a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java index 1b1ab7c788..9f9b41e23e 100644 --- a/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java +++ b/openflowplugin-it/src/test/java/org/opendaylight/openflowplugin/openflow/md/it/SalIntegrationTest.java @@ -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 aa6d6462d9..1a8abca459 100644 --- a/pom.xml +++ b/pom.xml @@ -211,7 +211,7 @@ sal-binding-broker-impl ${sal.binding.api.version} - @@ -368,11 +368,6 @@ - org.ops4j.pax.exam - maven-paxexam-plugin - 1.2.4 - - maven-clean-plugin -- 2.36.6