Skip to content

Commit

Permalink
the process status is not necessarily done by the time of calling recent
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Jan 14, 2024
1 parent 78896f4 commit 9ad7e08
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/test/java/com/gw/HistoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,9 @@ void testProcessRecentHistory() throws Exception {
"http://localhost:" + this.port + "/Geoweaver/web/recent",
postRequest, String.class);

System.out.println("Postresult = " + Postresult);

long startTime = System.currentTimeMillis();
long timeout = 10000;
long pollingInterval = 1000;

while (System.currentTimeMillis() - startTime < timeout) {
if (Postresult.contains("Done")) {
break;
}

Thread.sleep(pollingInterval);
}

assertThat(Postresult).contains("[");
assertThat(Postresult).contains("id");
assertThat(Postresult).contains("Done");
assertThat(Postresult).contains("testpython2");
assertThat(Postresult).contains("name");

ObjectMapper mapper = new ObjectMapper();
Expand Down

0 comments on commit 9ad7e08

Please sign in to comment.