This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch fix-graphql-list-search-refresh in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 0b795e53cab14d645cf781bdd6a509c20bf8de48 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; }
