From e74ec9425c0bb05ebbf5fc25e84486cf245177ec Mon Sep 17 00:00:00 2001 From: Gerard Olenski <31597546+gerardolenski@users.noreply.github.com> Date: Fri, 6 Jun 2025 11:29:52 +0200 Subject: [PATCH] ACS-9690 Fix unstable AddToHoldsBulkV1Tests (#3382) Co-authored-by: Belal Ansari --- .../rest/rm/community/hold/AddToHoldsBulkV1Tests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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..58130ecff0 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,16 @@ 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."); + // to improve stability on CI - seems that sometimes during big load we need to wait longer for the condition + await().atMost(120, TimeUnit.SECONDS) + .until(() -> getRestAPIFactory().getSearchAPI(null).search(ancestorSearchRequest).getPagination() + .getTotalItems() == NUMBER_OF_FILES); + holdBulkOperation = HoldBulkOperation.builder() .query(queryReq) .op(HoldBulkOperationType.ADD).build();