From ea333c91d5bb6950ae4deee37028abee26ef1308 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Fri, 1 Sep 2023 09:52:43 -0400 Subject: [PATCH 1/2] disable loading of metadata blocks in API tests #9868 Disabled because once there are new fields in the database that Solr doesn't know about, dataset creation could be prevented, or at least subsequent search operations could fail because the dataset can't be indexed. --- .../java/edu/harvard/iq/dataverse/api/AdminIT.java | 14 ++++++++++++++ .../java/edu/harvard/iq/dataverse/api/UtilIT.java | 9 ++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java b/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java index 2aee3bd38b2..a5a4924ad77 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java @@ -734,6 +734,13 @@ public void testMigrateHDLToDOI() { .statusCode(OK.getStatusCode()); } + /** + * Disabled because once there are new fields in the database that Solr + * doesn't know about, dataset creation could be prevented, or at least + * subsequent search operations could fail because the dataset can't be + * indexed. + */ + @Disabled @Test public void testLoadMetadataBlock_NoErrorPath() { Response createUser = UtilIT.createRandomUser(); @@ -778,6 +785,13 @@ public void testLoadMetadataBlock_NoErrorPath() { assertEquals(244, (int) statistics.get("Controlled Vocabulary")); } + /** + * Disabled because once there are new fields in the database that Solr + * doesn't know about, dataset creation could be prevented, or at least + * subsequent search operations could fail because the dataset can't be + * indexed. + */ + @Disabled @Test public void testLoadMetadataBlock_ErrorHandling() { Response createUser = UtilIT.createRandomUser(); diff --git a/src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java b/src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java index 0e3998f48a6..e47971f9b92 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java @@ -563,7 +563,14 @@ static Response updateDatasetPIDMetadata(String persistentId, String apiToken) .post("/api/datasets/:persistentId/modifyRegistrationMetadata/?persistentId=" + persistentId); return response; } - + + /** + * Deprecated because once there are new fields in the database that Solr + * doesn't know about, dataset creation could be prevented, or at least + * subsequent search operations could fail because the dataset can't be + * indexed. + */ + @Deprecated static Response loadMetadataBlock(String apiToken, byte[] body) { return given() .header(API_TOKEN_HTTP_HEADER, apiToken) From 4139f70c84ab279a3eec2d31db862bad825fad66 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Fri, 1 Sep 2023 11:29:18 -0400 Subject: [PATCH 2/2] double sleep when testing for links #9868 --- src/test/java/edu/harvard/iq/dataverse/api/MoveIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/MoveIT.java b/src/test/java/edu/harvard/iq/dataverse/api/MoveIT.java index d448a46a066..f7135ce7f3b 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/MoveIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/MoveIT.java @@ -300,7 +300,7 @@ public void testMoveLinkedDataset() { .statusCode(OK.getStatusCode()) .body("feed.entry[0].id", CoreMatchers.endsWith(datasetPid)); - UtilIT.sleepForReindex(datasetPid, superuserApiToken, 10); + UtilIT.sleepForReindex(datasetPid, superuserApiToken, 20); Response getLinksAfter = UtilIT.getDatasetLinks(datasetPid, superuserApiToken); getLinksAfter.prettyPrint(); getLinksAfter.then().assertThat()