Fix IMDS test synchronization 53/82553/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 18 Jun 2019 15:39:37 +0000 (17:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 18 Jun 2019 15:42:31 +0000 (17:42 +0200)
Before we close the DTCL we must make sure we flush all changes,
otherwise we could end up losing changes simply because we are no
longer interested in them.

JIRA: MDSAL-429
Change-Id: I6df384c375ea1692a10c9f460d3dceb626468061
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/DatastoreTestTask.java

index a62c0ba..74202a5 100644 (file)
@@ -119,6 +119,10 @@ public class DatastoreTestTask {
 
         execute(write);
         if (registration != null) {
+            // DCL is asynchronous, we need to make sure all tasks are executed before we close the registration,
+            // otherwise they would get lost
+            dclExecutorService.shutdown();
+            dclExecutorService.awaitTermination(5, TimeUnit.SECONDS);
             registration.close();
         }
 

©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.