Skip to content

Commit

Permalink
Add delay for creating two conversations
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Dec 6, 2023
1 parent e2b6b3d commit eefa37e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
Expand Down Expand Up @@ -120,7 +121,7 @@ public void testConversations_MorePages() throws IOException {
assert (((Double) map.get("next_token")).intValue() == 1);
}

public void testGetConversations_nextPage() throws IOException {
public void testGetConversations_nextPage() throws IOException, InterruptedException {
Response ccresponse1 = TestHelper.makeRequest(client(), "POST", ActionConstants.CREATE_CONVERSATION_REST_PATH, null, "", null);
assert (ccresponse1 != null);
assert (TestHelper.restStatus(ccresponse1) == RestStatus.OK);
Expand All @@ -131,6 +132,9 @@ public void testGetConversations_nextPage() throws IOException {
assert (ccmap1.containsKey("conversation_id"));
String id1 = (String) ccmap1.get("conversation_id");

// wait for 0.1s to make sure update time is different between conversation 1 and 2
TimeUnit.MICROSECONDS.sleep(100);

Response ccresponse2 = TestHelper.makeRequest(client(), "POST", ActionConstants.CREATE_CONVERSATION_REST_PATH, null, "", null);
assert (ccresponse2 != null);
assert (TestHelper.restStatus(ccresponse2) == RestStatus.OK);
Expand Down

0 comments on commit eefa37e

Please sign in to comment.