diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/hold/AddToHoldsBulkV1Tests.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/hold/AddToHoldsBulkV1Tests.java index 4b006b5e8e..198d76d4c6 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/hold/AddToHoldsBulkV1Tests.java +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/hold/AddToHoldsBulkV1Tests.java @@ -134,6 +134,15 @@ public class AddToHoldsBulkV1Tests extends BaseRMRestTest .until(() -> getRestAPIFactory().getSearchAPI(null).search(searchRequest).getPagination() .getTotalItems() == NUMBER_OF_FILES); + RestRequestQueryModel ancestorReq = getContentFromFolderAndAllSubfoldersQuery(rootFolder.getNodeRefWithoutVersion()); + SearchRequest ancestorSearchRequest = new SearchRequest(); + ancestorSearchRequest.setQuery(ancestorReq); + + STEP("Wait until paths are indexed."); + await().atMost(30, TimeUnit.SECONDS) + .until(() -> getRestAPIFactory().getSearchAPI(null).search(ancestorSearchRequest).getPagination() + .getTotalItems() == NUMBER_OF_FILES); + holdBulkOperation = HoldBulkOperation.builder() .query(queryReq) .op(HoldBulkOperationType.ADD).build();