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

jamesnetherton pushed a commit to branch camel-quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git


The following commit(s) were added to refs/heads/camel-quarkus-main by this 
push:
     new 0bcb1c91 Fix race in langchain4j-ingest-rag test waiting on ingestion 
of the return policy document
0bcb1c91 is described below

commit 0bcb1c91677630dcb935c1ecb62bc70062243604
Author: James Netherton <[email protected]>
AuthorDate: Tue Oct 20 07:37:51 2026 +0100

    Fix race in langchain4j-ingest-rag test waiting on ingestion of the return 
policy document
---
 .../org/acme/langchain4j/ingest/rag/Langchain4jIngestRagTest.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/langchain4j-ingest-rag/src/test/java/org/acme/langchain4j/ingest/rag/Langchain4jIngestRagTest.java
 
b/langchain4j-ingest-rag/src/test/java/org/acme/langchain4j/ingest/rag/Langchain4jIngestRagTest.java
index 8d9c80d8..7028adec 100644
--- 
a/langchain4j-ingest-rag/src/test/java/org/acme/langchain4j/ingest/rag/Langchain4jIngestRagTest.java
+++ 
b/langchain4j-ingest-rag/src/test/java/org/acme/langchain4j/ingest/rag/Langchain4jIngestRagTest.java
@@ -63,11 +63,15 @@ class Langchain4jIngestRagTest {
 
     }
 
-    /** Ingestion runs in the background after startup: wait until the return 
policy is searchable. */
+    /**
+     * Ingestion runs in the background after startup: wait until the return 
policy is searchable. The other documents
+     * also mention "30 days", so the hit must come from the policy document 
itself.
+     */
     static List<Map<String, Object>> awaitReturnPolicy() {
         return await().atMost(3, TimeUnit.MINUTES).pollInterval(1, 
TimeUnit.SECONDS)
                 .until(() -> search("How long do I have to return a product?"),
-                        hits -> hits.stream().anyMatch(hit -> 
String.valueOf(hit.get("text")).contains("30 days")));
+                        hits -> hits.stream().anyMatch(hit -> 
"company-policy.md".equals(hit.get("document"))
+                                && 
String.valueOf(hit.get("text")).contains("within 30 days of delivery")));
     }
 
     static List<Map<String, Object>> search(String question) {

Reply via email to