gabriel-farache commented on code in PR #4061:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4061#discussion_r2348861906


##########
quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/TokenPropagationIT.java:
##########
@@ -57,10 +66,76 @@ void tokenPropagations() {
         headers.put(SERVICE4_HEADER_TO_PROPAGATE, 
SERVICE4_AUTHORIZATION_TOKEN);
 
         JsonPath jsonPath = newProcessInstance("/token_propagation", 
processInput, headers);
-        Assertions.assertThat(jsonPath.getString("id")).isNotBlank();
+        String processInstanceId = jsonPath.getString("id");
+        Assertions.assertThat(processInstanceId).isNotBlank();
+        //Thread.sleep(20000);
+        waitForProcessCompletion(processInstanceId, Duration.ofSeconds(25));
+        validateExternalServiceInvocations();
     }
 
     protected static String buildProcessInput(String query) {
         return "{\"workflowdata\": {\"query\": \"" + query + "\"} }";
     }
+
+    private void waitForProcessCompletion(String processInstanceId, Duration 
timeout) {
+        long startTime = System.currentTimeMillis();
+        long timeoutMs = timeout.toMillis();
+
+        while (System.currentTimeMillis() - startTime < timeoutMs) {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to