sergehuber commented on code in PR #764:
URL: https://github.com/apache/unomi/pull/764#discussion_r3315929274


##########
itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java:
##########
@@ -77,15 +77,23 @@ public void testCRUD() throws Exception {
 
             refreshPersistence(UserList.class);
 
-            Thread.sleep(6000);
-
-            try (CloseableHttpResponse response = 
post("graphql/list/find-lists.json")) {
-                final ResponseContext context = 
ResponseContext.parse(response.getEntity());
-
-                Assert.assertEquals(1, ((Integer) 
context.getValue("data.cdp.findLists.totalCount")).intValue());
-                Assert.assertEquals("testListId", 
context.getValue("data.cdp.findLists.edges[0].node.id"));
-                Assert.assertEquals(profile.getItemId(), 
context.getValue("data.cdp.findLists.edges[0].node.active.edges[0].node.cdp_profileIDs[0].id"));
-            }
+            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());

Review Comment:
   The catch block already handles the checked exception thrown by `post()`, so 
the code compiles as-is. You're right that rethrowing as `RuntimeException` 
would be cleaner style, but it would also stop retries on any HTTP failure — 
the current broad catch is intentional since Karaf may not be ready when 
polling starts. The real issue (no diagnostics on swallowed exceptions) is 
addressed in the latest commit, which adds `LOGGER.warn(e.getMessage())` on 
each failed attempt.



-- 
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]

Reply via email to