BUG-5280: Close client history after all histories are closed 37/54037/9
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Wed, 29 Mar 2017 13:51:33 +0000 (15:51 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 1 Apr 2017 08:43:41 +0000 (08:43 +0000)
Make sure record history state as closed once we are done with
it.

Change-Id: Icbdf947ad166b082e06df896741e618e801ecf2e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java

index a3afa22..c15c7c8 100644 (file)
@@ -88,6 +88,7 @@ public abstract class AbstractClientHistory extends LocalAbortable implements Id
         if (local != State.CLOSED) {
             Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this);
             histories.values().forEach(ProxyHistory::close);
+            updateState(local, State.CLOSED);
         }
     }
 
index 11379a0..a8fc8ee 100644 (file)
@@ -1002,9 +1002,6 @@ public class DistributedDataStoreIntegrationTest {
 
     @Test
     public void testCreateChainedTransactionAfterClose() throws Exception {
-        //TODO remove when test passes also for ClientBackedDataStore
-        Assume.assumeTrue(testParameter.equals(DistributedDataStore.class));
-
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (AbstractDataStore dataStore = setupAbstractDataStore(
@@ -1023,9 +1020,6 @@ public class DistributedDataStoreIntegrationTest {
 
     @Test
     public void testChainWithReadOnlyTxAfterPreviousReady() throws Exception {
-        //TODO remove when test passes also for ClientBackedDataStore
-        Assume.assumeTrue(testParameter.equals(DistributedDataStore.class));
-
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (final AbstractDataStore dataStore = setupAbstractDataStore(
@@ -1165,9 +1159,6 @@ public class DistributedDataStoreIntegrationTest {
 
     @Test
     public void testChangeListenerRegistration() throws Exception {
-        //TODO remove when test passes also for ClientBackedDataStore
-        Assume.assumeTrue(testParameter.equals(DistributedDataStore.class));
-
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (final AbstractDataStore dataStore = setupAbstractDataStore(

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.