oscerd commented on code in PR #22357:
URL: https://github.com/apache/camel/pull/22357#discussion_r3020549319
##########
components/camel-ai/camel-docling/src/test/java/org/apache/camel/component/docling/integration/DoclingServeProducerIT.java:
##########
@@ -245,14 +245,20 @@ void testCheckConversionStatus() throws Exception {
assertNotNull(taskId, "Task ID should not be null");
- // Wait a bit for processing
- Thread.sleep(1000);
+ // Poll until completed (the async future may take longer than a fixed
sleep)
+ ConversionStatus status = null;
+ int maxAttempts = 120;
+ for (int i = 0; i < maxAttempts; i++) {
+ status = template.requestBody("direct:check-status", taskId,
ConversionStatus.class);
+ assertNotNull(status, "Status should not be null");
+ assertNotNull(status.getTaskId(), "Status task ID should not be
null");
- // Check status
- ConversionStatus status = template.requestBody("direct:check-status",
taskId, ConversionStatus.class);
+ if (status.getStatus() == Status.COMPLETED || status.getStatus()
== Status.FAILED) {
+ break;
+ }
+ Thread.sleep(1000);
Review Comment:
This needs to be addressed
--
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]