From 39609b1eb19be4ace637cb0774f69c890103052d Mon Sep 17 00:00:00 2001 From: Tony Tkacik Date: Tue, 24 Jun 2014 09:31:00 +0200 Subject: [PATCH] Fixed concurrency bug in DOMTransactionChainTest Delete transaction was commited before read was verified since transaction commit was done in other thread there was race-condition between allocating transactions to verify datastore state. Change-Id: I1717efbe160e59f42c3baca2f5a5f053d703350e Signed-off-by: Tony Tkacik --- .../broker/impl/DOMTransactionChainTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java index 2a955e5f42..38f08b30f9 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java +++ b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java @@ -104,28 +104,29 @@ public class DOMTransactionChainTest { */ DOMDataReadWriteTransaction thirdDeleteTx = allocateAndDelete(txChain); - /** - * third transaction is sealed. - */ - ListenableFuture> thirdDeleteTxFuture = thirdDeleteTx.commit(); - /** * We commit first transaction * */ assertCommitSuccessful(firstWriteTxFuture); - // Alocates store transaction + /** + * + * Allocates transaction from data store. + * + */ DOMDataReadTransaction storeReadTx = domBroker.newReadOnlyTransaction(); + /** * We verify transaction is commited to store, container should exists * in datastore. */ assertTestContainerExists(storeReadTx); + /** - * We commit third transaction - * + * third transaction is sealed and commited */ + ListenableFuture> thirdDeleteTxFuture = thirdDeleteTx.commit(); assertCommitSuccessful(thirdDeleteTxFuture); /** -- 2.36.6