You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2022/04/14 13:40:15 UTC

[GitHub] [unomi] sergehuber commented on a diff in pull request #404: first commit to fix tests

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


##########
itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java:
##########
@@ -275,17 +294,14 @@ public void testCreateEventsWithNoTimestampParam_profileAddedToSegment() throws
         request.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequest), ContentType.APPLICATION_JSON));
         String cookieHeaderValue = TestUtils.executeContextJSONRequest(request, sessionId).getCookieHeaderValue();
         refreshPersistence();
-        Thread.sleep(1000); //Making sure DB is updated
-
         //Add the context-profile-id cookie to the second event
         request.addHeader("Cookie", cookieHeaderValue);
-        ContextResponse response = (TestUtils.executeContextJSONRequest(request, sessionId)).getContextResponse(); //second event
-
+        ContextResponse response = TestUtils.executeContextJSONRequest(request, sessionId).getContextResponse(); //second event
         refreshPersistence();

Review Comment:
   Do we need this call also ?



##########
itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java:
##########
@@ -125,9 +132,11 @@ public void setUp() throws InterruptedException, IOException {
         profile = new Profile(profileId);
         profileService.save(profile);
 
-        keepTrying("Couldn't find json schema endpoint",
-                () -> get(JSONSCHEMA_URL, List.class), Objects::nonNull,
+        keepTrying("Profile " + profileId + " not found in the required time", () -> profileService.load(profileId), Objects::nonNull,
                 DEFAULT_TRYING_TIMEOUT, DEFAULT_TRYING_TRIES);
+
+        keepTrying("Couldn't find json schema endpoint", () -> get(JSONSCHEMA_URL, List.class), Objects::nonNull, DEFAULT_TRYING_TIMEOUT,
+                DEFAULT_TRYING_TRIES);
         refreshPersistence();

Review Comment:
   Do we need to keep this call ? 



-- 
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: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org