-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use waitUntil to check if bucket is deleted #177
Conversation
@krisis Travis failed due to
|
run/core/aws-sdk-php/quick-tests.php
Outdated
@@ -886,6 +886,8 @@ function testBucketPolicy($s3Client, $params) { | |||
throw new Exception('createBucket API failed for ' . | |||
$bucket); | |||
} | |||
} finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to find out if a bucket is deleted or not here. So, the determination process more like belongs to the delete logic, rather than retry logic for createBucket
api. Hence, I suggest to start checking with bucketExists
api in a timed-out loop instead. waitUntil
api looks great to be used for this purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ebozduman Yes, this is a good point. I have made the necessary changes.
run/core/aws-sdk-php/quick-tests.php
Outdated
@@ -991,15 +993,16 @@ function runTest($s3Client, $myfunc, $fnSignature, $args = []) { | |||
if ($errorCode != "NotImplemented") { | |||
$status = "FAIL"; | |||
$error = $e->getMessage(); | |||
} else { | |||
$status = "NA"; | |||
$message = "Not Implemented"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since alert
field is delivering the Not Implemented
message, I don't think we need the $message = "Not Implemented"
here. It can be eliminated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense. Done.
run/core/aws-sdk-php/quick-tests.php
Outdated
// $fnSignature holds the specific API that is being | ||
// tested. It is possible that functions used to create the | ||
// test setup may not be implemented. | ||
$alert = sprintf("%s or a related API is not implemented, see \"error\" for exact details.", $fnSignature); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a personal preference of course, but I'd change the alert
message as:
"%s or a related API has NOT been IMPLEMENTED yet. Please see the \"error\" for exact details."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, I have updated the alert message accordingly.
4101297
to
2608213
Compare
aae2901
to
31a8c75
Compare
@ebozduman PR is updated, can you please check |
run/core/aws-sdk-php/quick-tests.php
Outdated
} | ||
} | ||
} while ($retries > 0); | ||
|
||
// This means createBucket failed after $retries attempt separated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to change the comment like:
// This means createBucket failed after $retries attempt separated by $delay seconds.
==>
// $retries == 0 means createBucket failed and we timed out
run/core/aws-sdk-php/quick-tests.php
Outdated
// This means createBucket failed after $retries attempt separated | ||
// by $delay seconds. | ||
if ($retries == 0) { | ||
throw new Exception(sprintf("createBucket API failed after %d separated by %ds", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retries
at this point is 0
.
So, either we have to use a constant for the maximum number of retries and use it in this error message, while using a separate iterator to count the number of retries inside the while loop, or modify the error message without printing how many times we've tried, like:
Bucket delete failure, timed out!
run/core/aws-sdk-php/quick-tests.php
Outdated
// test setup may not be implemented. | ||
$alert = sprintf("%s or a related API is not implemented, see \"error\" for exact details.", $fnSignature); | ||
} finally { | ||
}finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space between }
and finally {
run/core/aws-sdk-php/quick-tests.php
Outdated
$retries = 5; | ||
while ($retries > 0) { | ||
// least 30s to be truly deleted. | ||
// Ref: https://docs.microsoft.com/en-us/rest/api/storageservices/create-container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reason we are relying and ensuring that container is deleted? eventual consistency is fine. we don't need to verify backend consistency for deletes IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshavardhana from our discussion I understand that this regression test could getBucketPolicy after a deleteBucket to confirm that bucket policies don't remain once the bucket is deleted. This allows us to simplify this test case by removing the retry mechanism.
31a8c75
to
86b9445
Compare
@krisis I tested this on local Minio server, tests fail
|
blocked till failure is resolved/clarified |
86b9445
to
4454078
Compare
@nitisht I have fixed the failure you observe on server, but this doesn't fix the issue on Azure gateway. |
30s wait be fine we can revisit this.. |
ok so is this ready to be merged. |
@deekoder no, this PR isn't ready to be merged. As is it won't work with Minio gateway for Azure. |
The test is applicable only to minio server and that can be tested without creating the bucket again. This allows us to remove the retry creation of bucket on failure for about 30s.
4454078
to
922a245
Compare
@nitisht @harshavardhana I have added an unconditional sleep to make mint aws-sdk-php functional tests run successfully on server and gateway (for Azure). |
Works fine @krisis will merge. |
This issue is marked From: Harshavardhana notifications@github.com The reason we need to discuss this is to see if its a good idea to add these delays in our test code, perhaps even come up with modes for gateway where we have a separate setup and teardown such that we do not have to relax actual minio server tests which are strongly consistent and make them eventual consistent. // cc @krisis @balamurugana @nitisht @kannappanr @ebozduman From: Krishnan Parthasarathi notifications@github.com |
[EDIT] testBucketPolicy creates a bucket immediately after deleting a bucket. Object storage services like Azure Blob Storage may not have deleted the bucket (container in this case) failing the create bucket operation. This change uses
waitUntil
method to avoid the explicit retry mechanism.Found while testing #168