This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch fixSegmentITwaitForStartup
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit e0f783d437205b4a35771cc56e6a6c1ab0e01dfc
Author: Kevan <[email protected]>
AuthorDate: Wed Feb 24 15:09:33 2021 +0100

    UNOMI-419: fix SegmentsIT test to wait on full startup
---
 itests/src/test/java/org/apache/unomi/itests/SegmentIT.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java 
b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
index fceb70c..1ca2e8b 100644
--- a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
@@ -22,6 +22,7 @@ import org.apache.unomi.api.conditions.Condition;
 import org.apache.unomi.api.segments.Segment;
 import org.apache.unomi.api.services.SegmentService;
 import org.apache.unomi.api.exceptions.BadSegmentConditionException;
+import org.apache.unomi.lifecycle.BundleWatcher;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -46,8 +47,15 @@ public class SegmentIT extends BaseIT {
     @Filter(timeout = 600000)
     protected SegmentService segmentService;
 
+    @Inject @Filter(timeout = 600000)
+    protected BundleWatcher bundleWatcher;
+
     @Before
     public void setUp() throws InterruptedException {
+        while (!bundleWatcher.isStartupComplete()) {
+            LOGGER.info("Waiting for startup to complete...");
+            Thread.sleep(1000);
+        }
         removeItems(Segment.class);
     }
 

Reply via email to