From f07b8240668177f1bda5b715d713a83900b9508c Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Fri, 26 Aug 2022 09:10:14 -0400 Subject: [PATCH 1/2] doubles the sleep interval in a harvesting test. #8937 --- .../java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java b/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java index 635a8a16ec5..0bd894bce44 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java @@ -241,7 +241,7 @@ public void testOaiFunctionality() throws InterruptedException { Response exportSetResponse = UtilIT.exportOaiSet(setName); assertEquals(200, exportSetResponse.getStatusCode()); //SEK 09/04/2019 resonable wait time for export OAI? #6128 - Thread.sleep(5000L); + Thread.sleep(10000L); Response getSet = given() .get(apiPath); From 781ca745f6ab739b4a72c1c0c984889434c99e9b Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Fri, 26 Aug 2022 14:16:54 -0400 Subject: [PATCH 2/2] sleep added in the right place (#8937) --- .../harvard/iq/dataverse/api/HarvestingServerIT.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java b/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java index 0bd894bce44..7579ab265fd 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/HarvestingServerIT.java @@ -223,7 +223,13 @@ public void testOaiFunctionality() throws InterruptedException { logger.info("identifier: " + identifier); // Let's try and create an OAI set with the dataset we have just - // created and published: + // created and published: + // - however, publish command is executed asynchronously, i.e. it may + // still be running after we received the OK from the publish API. + // So let's give it a couple of extra seconds to finish, to make sure + // the dataset is published, exported and indexed - because the OAI + // set create API requires all of the above. + Thread.sleep(3000L); String setName = identifier; String setQuery = "dsPersistentId:" + identifier; String apiPath = String.format("/api/harvest/server/oaisets/%s", setName); @@ -241,7 +247,7 @@ public void testOaiFunctionality() throws InterruptedException { Response exportSetResponse = UtilIT.exportOaiSet(setName); assertEquals(200, exportSetResponse.getStatusCode()); //SEK 09/04/2019 resonable wait time for export OAI? #6128 - Thread.sleep(10000L); + Thread.sleep(5000L); Response getSet = given() .get(apiPath);