Skip to content

Commit

Permalink
add 1-2 second delays in tests for softAutocomplete at 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed May 13, 2024
1 parent e9dce2d commit c7a443f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public void testMoveDataverse() {
while (checkIndex) {
try {
try {
Thread.sleep(4000);
Thread.sleep(6000);
} catch (InterruptedException ex) {
}
Response search = UtilIT.search("id:dataverse_" + dataverseId + "&subtree=" + dataverseAlias2, apiToken);
Expand Down
8 changes: 7 additions & 1 deletion src/test/java/edu/harvard/iq/dataverse/api/LinkIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ public void testDeepLinks() {
linkLevel1toLevel1.then().assertThat()
.statusCode(OK.getStatusCode())
.body("data.message", equalTo("Dataverse " + level1a + " linked successfully to " + level1b));

try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
/**
* With solrconfig autoSoftCommit set to 1000 (1sec), this sleep is needed.
*/
}
Response searchLevel1toLevel1 = UtilIT.search("*", apiToken, "&subtree=" + level1b);
searchLevel1toLevel1.prettyPrint();
searchLevel1toLevel1.then().assertThat()
Expand Down
10 changes: 8 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/api/SearchIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,13 @@ public void testNestedSubtree() {
Response createDataverseResponse2 = UtilIT.createSubDataverse("subDV" + UtilIT.getRandomIdentifier(), null, apiToken, dataverseAlias);
createDataverseResponse2.prettyPrint();
String dataverseAlias2 = UtilIT.getAliasFromResponse(createDataverseResponse2);

try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
/**
* With solrconfig autoSoftCommit set to 1000 (1sec), this sleep is needed.
*/
}
String searchPart = "*";

Response searchUnpublishedSubtree = UtilIT.search(searchPart, apiToken, "&subtree="+dataverseAlias);
Expand Down Expand Up @@ -968,7 +974,7 @@ public void testSubtreePermissions() {
.statusCode(OK.getStatusCode());

// Wait a little while for the index to pick up the datasets, otherwise timing issue with searching for it.
UtilIT.sleepForReindex(datasetId2.toString(), apiToken, 2);
UtilIT.sleepForReindex(datasetId2.toString(), apiToken, 3);

String identifier = JsonPath.from(datasetAsJson.getBody().asString()).getString("data.identifier");
String identifier2 = JsonPath.from(datasetAsJson2.getBody().asString()).getString("data.identifier");
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class UtilIT {
private static final String API_TOKEN_KEY = "apiToken";
private static final String BUILTIN_USER_KEY = "burrito";
private static final String EMPTY_STRING = "";
public static final int MAXIMUM_INGEST_LOCK_DURATION = 15;
public static final int MAXIMUM_INGEST_LOCK_DURATION = 16; // 15 + 1 sec for current autoSoftCommit duration
public static final int MAXIMUM_PUBLISH_LOCK_DURATION = 20;
public static final int MAXIMUM_IMPORT_DURATION = 1;

Expand Down

0 comments on commit c7a443f

Please sign in to comment.