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/20 14:09:59 UTC
[unomi] 01/02: 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 master
in repository https://gitbox.apache.org/repos/asf/unomi.git
commit e6f7d49dd35e2255a44865496ca4a7f17b961a2f
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);