From f6d08bb2fcef119b39a3e3a193dc5826026ea7a9 Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Wed, 14 Dec 2022 10:55:12 -0500 Subject: [PATCH] trigger another Jenkins run, with the time delay slightly rearranged in the wait for an async. operation + some extra logging (#8843) --- .../edu/harvard/iq/dataverse/api/HarvestingClientsIT.java | 8 ++++++-- .../edu/harvard/iq/dataverse/api/HarvestingServerIT.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/HarvestingClientsIT.java b/src/test/java/edu/harvard/iq/dataverse/api/HarvestingClientsIT.java index 3fc72125145..094eb0df77c 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/HarvestingClientsIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/HarvestingClientsIT.java @@ -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); @@ -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); @@ -240,7 +245,6 @@ public void testHarvestingClientRun() throws InterruptedException { // ok, it looks like the harvest has completed successfully. break; } - Thread.sleep(1000L); } while (i