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

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


The following commit(s) were added to 
refs/heads/optimizeProfileQueryDuringSegmentRemove by this push:
     new 633a4fa12 UNOMI-557: Optimize the profile update during segment 
deletion
633a4fa12 is described below

commit 633a4fa12f6088b35c3ade2cf49890952feb6223
Author: Kevan <[email protected]>
AuthorDate: Wed Jun 1 15:41:35 2022 +0200

    UNOMI-557: Optimize the profile update during segment deletion
---
 itests/src/test/java/org/apache/unomi/itests/SegmentIT.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 17698fad7..329555bde 100644
--- a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
@@ -181,17 +181,19 @@ public class SegmentIT extends BaseIT {
         segmentCondition.setParameter("comparisonOperator", "exists");
         segment.setCondition(segmentCondition);
         segmentService.setSegmentDefinition(segment);
+        persistenceService.refreshIndex(Profile.class, null);
 
         // insure the profile that did the past event condition is correctly 
engaged in the segment.
         keepTrying("Profile should be engaged in the segment", () -> 
profileService.load("test_profile_id"),
-                updatedProfile -> 
updatedProfile.getSegments().contains("add-delete-segment-test"), 1000, 20);
+                loadedProfile -> loadedProfile != null && 
loadedProfile.getSegments() != null && 
loadedProfile.getSegments().contains("add-delete-segment-test"), 2000, 20);
 
         // delete the segment
         segmentService.removeSegmentDefinition("add-delete-segment-test", 
false);
+        persistenceService.refreshIndex(Profile.class, null);
 
         // insure the profile is not engaged anymore after segment deleted
         keepTrying("Profile should not be engaged in the segment anymore after 
the segment have been deleted", () -> profileService.load("test_profile_id"),
-                loadedProfile -> loadedProfile != null && 
(loadedProfile.getSegments() == null || 
!loadedProfile.getSegments().contains("add-delete-segment-test")), 1000, 20);
+                loadedProfile -> loadedProfile != null && 
(loadedProfile.getSegments() == null || 
!loadedProfile.getSegments().contains("add-delete-segment-test")), 2000, 20);
     }
 
     @Test

Reply via email to