You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2022/02/18 15:17:12 UTC

[unomi] branch UNOMI-552 updated: UNOMI-552 Fix failing integration tests - Fix unstable segment integration test due to inconsistent profile state

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

shuber pushed a commit to branch UNOMI-552
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/UNOMI-552 by this push:
     new 1707438  UNOMI-552 Fix failing integration tests - Fix unstable segment integration test due to inconsistent profile state
1707438 is described below

commit 17074381573293059415b940605b80acfbc32558
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Fri Feb 18 16:17:04 2022 +0100

    UNOMI-552 Fix failing integration tests
    - Fix unstable segment integration test due to inconsistent profile state
---
 itests/src/test/java/org/apache/unomi/itests/SegmentIT.java | 5 +++++
 1 file changed, 5 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 b2942c7..470a3cb 100644
--- a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
@@ -217,6 +217,9 @@ public class SegmentIT extends BaseIT {
                 updatedProfile -> updatedProfile.getSegments().contains("negative-past-event-segment-test"),
                 1000, 20);
 
+        // we load the profile so that we are sure that it contains the segments
+        profile = profileService.load("test_profile_id");
+
         // send event for profile from a previous date (today -3 days)
         ZoneId defaultZoneId = ZoneId.systemDefault();
         LocalDate localDate = LocalDate.now().minusDays(3);
@@ -256,6 +259,7 @@ public class SegmentIT extends BaseIT {
         segmentService.setSegmentDefinition(segment);
         Thread.sleep(5000);
 
+        profile = profileService.load("test_profile_id");
         // Persist the event (do not send it into the system so that it will not be processed by the rules)
         ZoneId defaultZoneId = ZoneId.systemDefault();
         LocalDate localDate = LocalDate.now().minusDays(3);
@@ -504,6 +508,7 @@ public class SegmentIT extends BaseIT {
         refreshPersistence();
 
         // Send 2 events that match the scoring plan.
+        profile = profileService.load("test_profile_id");
         Event testEvent = new Event("test-event-type", null, profile, null, null, profile, timestampEventInRange);
         testEvent.setPersistent(true);
         eventService.send(testEvent);