Skip to content

Commit

Permalink
trigger another Jenkins run, with the time delay slightly rearranged …
Browse files Browse the repository at this point in the history
…in the wait for an async. operation + some extra logging (#8843)
  • Loading branch information
landreev committed Dec 14, 2022
1 parent abd6ded commit f6d08bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ public void testHarvestingClientRun() throws InterruptedException {
int i = 0;
int maxWait=20; // a very conservative interval; this harvest has no business taking this long
do {
// Give it an initial 1 sec. delay, to make sure the client state
// has been updated in the database, which can take some appreciable
// amount of time on a heavily-loaded server running a full suite of
// tests:
Thread.sleep(1000L);
// keep checking the status of the client with the GET api:
Response getClientResponse = given()
.get(clientApiPath);
Expand All @@ -226,7 +231,7 @@ public void testHarvestingClientRun() throws InterruptedException {
assertEquals("Unexpected client status: "+clientStatus, "inActive", clientStatus);

// b) Confirm that it has actually succeeded:
assertEquals("Last harvest not reported a success", "SUCCESS", responseJsonPath.getString("data.lastResult"));
assertEquals("Last harvest not reported a success (took "+i+" seconds)", "SUCCESS", responseJsonPath.getString("data.lastResult"));
String harvestTimeStamp = responseJsonPath.getString("data.lastHarvest");
assertNotNull(harvestTimeStamp);

Expand All @@ -240,7 +245,6 @@ public void testHarvestingClientRun() throws InterruptedException {
// ok, it looks like the harvest has completed successfully.
break;
}
Thread.sleep(1000L);
} while (i<maxWait);

System.out.println("Waited " + i + " seconds for the harvest to complete.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ private String jsonForEditSpec(String name, String def, String desc) {
}

private XmlPath validateOaiVerbResponse(Response oaiResponse, String verb) {
logger.info(verb+" response: "+oaiResponse.prettyPrint());
// confirm that the response is in fact XML:
XmlPath responseXmlPath = oaiResponse.getBody().xmlPath();
assertNotNull(responseXmlPath);
Expand Down

0 comments on commit f6d08bb

Please sign in to comment.