Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/test/java/edu/harvard/iq/dataverse/api/SearchIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,29 @@ public void testNestedSubtree() {
Response publishDataverse = UtilIT.publishDataverseViaNativeApi(dataverseAlias, apiToken);
publishDataverse.then().assertThat()
.statusCode(OK.getStatusCode());


try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
/**
* This sleep is here because dataverseAlias2 is showing with
* discoverableBy of group_public first and then overwritten by
* group_user224 (or whatever) later. This is backward from what we
* expect. We expect group_user224 to be in discoverableBy first
* while the dataverse is unpublished (only that users can see it)
* and then we want discoverableBy to change to group_public when
* the dataverse is published (everyone can see it).
*
* The theory on this bug, this timing issue, is that the indexing
* from "create" is being queued up and happens after the indexing
* from "publish".
*
* Please note that if you remove this sleep and run SearchIT in
* isolation, it passes. To exercise this bug you have to run
* multiple API tests at once such as SearchIT and DatasetsIT.
*/
}

Response publishDataverse2 = UtilIT.publishDataverseViaNativeApi(dataverseAlias2, apiToken);
publishDataverse2.then().assertThat()
.statusCode(OK.getStatusCode());
Expand Down