Skip to content

Commit

Permalink
need to sleep 5 seconds to make sure the process is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Jan 14, 2024
1 parent 9ad7e08 commit 93bafb7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/java/com/gw/HistoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ void testProcessRecentHistory() throws Exception {

ltmock.executePythonProcess(historyid, pid, "100001", "dummyrsastring", historyid, true, "", "", "");

// sleep for 5 seconds to ensure the process is complete
Thread.sleep(5000);

HttpHeaders postHeaders = new HttpHeaders();
postHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

Expand All @@ -112,6 +115,7 @@ void testProcessRecentHistory() throws Exception {
assertThat(Postresult).contains("[");
assertThat(Postresult).contains("id");
assertThat(Postresult).contains("testpython2");
assertThat(Postresult).contains("Done");
assertThat(Postresult).contains("name");

ObjectMapper mapper = new ObjectMapper();
Expand Down

0 comments on commit 93bafb7

Please sign in to comment.