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

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


The following commit(s) were added to refs/heads/master by this push:
     new a561a00dd Refresh list indexes on each poll in GraphQLListIT (#884)
a561a00dd is described below

commit a561a00ddbabc5f3081763f3c29cf8ea3177ef81
Author: Serge Huber <[email protected]>
AuthorDate: Thu Sep 24 19:55:46 2026 +0200

    Refresh list indexes on each poll in GraphQLListIT (#884)
---
 .../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