[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 <prajwolamatya11@gmail.com>
This commit is contained in:
Prajwol Amatya authored and GitHub committed 2026-09-18 17:10:39 +05:45
1 parent a700f0cccc
commit 5d9d80b45b
1 file changed
+14 -1
+14 -1
View File
@@ -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);
}
/**