From f2eac8e7c453036de46f236606c892af69a385fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:33:06 +1000 Subject: [PATCH] KOGITO-9387 - Make retry to check Data Index data (#1700) (#1701) Co-authored-by: Cristiano Nicolai <570894+cristianonicolai@users.noreply.github.com> --- .../org/kie/kogito/examples/DataIndexRestIT.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java index e20124127d..b09be166f9 100644 --- a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java @@ -61,11 +61,15 @@ void testDataIndexRest() { .then() .statusCode(404)); - given().contentType(ContentType.JSON).body("{ \"query\" : \"{ ProcessInstances(where: { id: {equal: \\\"" + processInstanceId + "\\\"}}) { id, state } }\" }") - .when().post("/graphql") - .then().statusCode(200) - .body("data.ProcessInstances.size()", is(1)) - .body("data.ProcessInstances[0].id", is(processInstanceId)) - .body("data.ProcessInstances[0].state", is("COMPLETED")); + await() + .atLeast(1, SECONDS) + .atMost(30, SECONDS) + .with().pollInterval(1, SECONDS) + .untilAsserted(() -> given().contentType(ContentType.JSON).body("{ \"query\" : \"{ ProcessInstances(where: { id: {equal: \\\"" + processInstanceId + "\\\"}}) { id, state } }\" }") + .when().post("/graphql") + .then().statusCode(200) + .body("data.ProcessInstances.size()", is(1)) + .body("data.ProcessInstances[0].id", is(processInstanceId)) + .body("data.ProcessInstances[0].state", is("COMPLETED"))); } }