From 5d9d80b45bb6d37d65262d174b862e9332348fd2 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya <83579989+PrajwolAmatya@users.noreply.github.com> Date: Fri, 18 Sep 2026 17:10:39 +0545 Subject: [PATCH] [tests-only][full-ci] test: retry copy operation on 500 status code (#12973) test: retry copy opetation on 500 status code Signed-off-by: Prajwol Amatya --- tests/acceptance/bootstrap/SpacesContext.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 22a9b1f5302..531e9a02ec1 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -2270,7 +2270,20 @@ class SpacesContext implements Context { $davPath = WebdavHelper::getDavPath(WebDavHelper::DAV_VERSION_SPACES, $space["id"]); $fullUrl = "$baseUrl/$davPath/$encodedName"; - $this->featureContext->setResponse($this->copyFilesAndFoldersRequest($user, $fullUrl, $headers)); + // With OCIS_ASYNC_UPLOADS=true in CI, file may still be in postprocessing while copying it. + // And the copy operation just returns 500 status code + // So retrying the copy operation + $retried = 0; + do { + $response = $this->copyFilesAndFoldersRequest($user, $fullUrl, $headers); + if ($response->getStatusCode() !== 500) { + break; + } + $retried++; + \sleep(1); + } while ($retried < STANDARD_RETRY_COUNT); + + $this->featureContext->setResponse($response); } /**