Skip to content

Commit

Permalink
allow delta between completed job status registred stats and instanta…
Browse files Browse the repository at this point in the history
…neous elapsed time
  • Loading branch information
cmangeat committed Feb 3, 2025
1 parent 48d60a7 commit 6a5e1ca
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,21 @@ private String doCreateAndPollAndGetReport(
downloadURL = createResponseJson.getString(MapPrinterServlet.JSON_DOWNLOAD_LINK);
assertEquals("/print/report/" + ref, downloadURL);

reportReady = statusJson.getBool(MapPrinterServlet.JSON_DONE);

long allowDeltaBetweenCompletedJobStatusRegistredStatsAndInstantaneousElapsedTime =
reportReady ? 200 : 0;

timeElapsed = statusJson.getInt(MapPrinterServlet.JSON_ELAPSED_TIME);
assertTrue(
"lastTimeElapsed: "
+ lastTimeElapsed
+ " is not less or equal to timeElapsed: "
+ timeElapsed,
lastTimeElapsed <= timeElapsed);
timeElapsed - lastTimeElapsed
>= allowDeltaBetweenCompletedJobStatusRegistredStatsAndInstantaneousElapsedTime);
lastTimeElapsed = timeElapsed;

reportReady = statusJson.getBool(MapPrinterServlet.JSON_DONE);
if (!reportReady) {
Thread.sleep(500);
}
Expand Down

0 comments on commit 6a5e1ca

Please sign in to comment.