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

sergehuber pushed a commit to branch write-filtered-personalization-contents
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to 
refs/heads/write-filtered-personalization-contents by this push:
     new 741cd2c65 Refresh the list index on each poll so membership search is 
not stuck on an early refresh.
741cd2c65 is described below

commit 741cd2c653151bbe74de04601c6dee806f0f3c5b
Author: Serge Huber <[email protected]>
AuthorDate: Thu Sep 24 06:26:10 2026 +0200

    Refresh the list index on each poll so membership search is not stuck on an 
early refresh.
---
 .../org/apache/unomi/itests/graphql/GraphQLListIT.java   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java 
b/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
index 7b378948e..6279556fd 100644
--- a/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
@@ -75,15 +75,17 @@ public class GraphQLListIT extends BaseGraphQLIT {
                 Assert.assertEquals("testListId", 
context.getValue("data.cdp.addProfileToList.id"));
             }
 
-            refreshPersistence(UserList.class, Profile.class);
-
-            // The list membership is written to the profile synchronously by 
addProfileToList,
-            // then made searchable via the index refresh above; keepTrying 
only absorbs normal
-            // Elasticsearch refresh latency.
+            // addProfileToList saves the profile, then findLists searches it. 
A single refresh
+            // issued before the document is visible stays stale for every 
later poll, which is
+            // why this wait fails intermittently on both Elasticsearch and 
OpenSearch. Refresh
+            // on each attempt so a write that lands after the first refresh 
becomes searchable.
             final ResponseContext findListsContext = keepTrying("Failed 
waiting for profile in list query",
                     () -> {
-                        try (CloseableHttpResponse response = 
post("graphql/list/find-lists.json")) {
-                            return ResponseContext.parse(response.getEntity());
+                        try {
+                            refreshPersistence(UserList.class, Profile.class);
+                            try (CloseableHttpResponse response = 
post("graphql/list/find-lists.json")) {
+                                return 
ResponseContext.parse(response.getEntity());
+                            }
                         } catch (Exception e) {
                             return null;
                         }

Reply via email to