Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] Retry if 409 is received when uploading in a Given step #6843

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 40 additions & 5 deletions tests/TestHelpers/UploadHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class UploadHelper extends Assert {
* @param int|null $chunkingVersion (1|2|null)
* if set to null chunking will not be used
* @param int|null $noOfChunks how many chunks to upload
* @param bool|null $isGivenStep
*
* @return ResponseInterface
* @throws GuzzleException
Expand All @@ -63,7 +64,8 @@ public static function upload(
?array $headers = [],
?int $davPathVersionToUse = 1,
?int $chunkingVersion = null,
?int $noOfChunks = 1
?int $noOfChunks = 1,
?bool $isGivenStep = false
): ResponseInterface {
//simple upload with no chunking
if ($chunkingVersion === null) {
Expand All @@ -77,7 +79,16 @@ public static function upload(
$headers,
$xRequestId,
$data,
$davPathVersionToUse
$davPathVersionToUse,
"files",
null,
"basic",
false,
0,
null,
[],
null,
$isGivenStep
);
} else {
//prepare chunking
Expand All @@ -102,7 +113,15 @@ public static function upload(
$xRequestId,
null,
$davPathVersionToUse,
"uploads"
"uploads",
null,
"basic",
false,
0,
null,
[],
null,
$isGivenStep
);
if ($result->getStatusCode() >= 400) {
return $result;
Expand Down Expand Up @@ -130,7 +149,15 @@ public static function upload(
$xRequestId,
$chunk,
$davPathVersionToUse,
$davRequestType
$davRequestType,
null,
"basic",
false,
0,
null,
[],
null,
$isGivenStep
);
if ($result->getStatusCode() >= 400) {
return $result;
Expand All @@ -152,7 +179,15 @@ public static function upload(
$xRequestId,
null,
$davPathVersionToUse,
"uploads"
"uploads",
null,
"basic",
false,
0,
null,
[],
null,
$isGivenStep
);
if ($result->getStatusCode() >= 400) {
return $result;
Expand Down
Loading