[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:
1 parent
a700f0cccc
commit
5d9d80b45b
1 file changed
+14
-1
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user