minio / mint

Collection of tests to detect overall correctness of MinIO server.
Apache License 2.0
79 stars 50 forks source link

Use waitUntil to check if bucket is deleted #177

Closed krisis closed 6 years ago

krisis commented 6 years ago

[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

nitisht commented 6 years ago

@krisis Travis failed due to

Step 21/39 : RUN build/aws-sdk-php/install.sh
 ---> Running in c214f0b4622e
Could not open input file: /mint/run/core/aws-sdk-php/composer.phar
The command '/bin/sh -c build/aws-sdk-php/install.sh' returned a non-zero code: 1
nitisht commented 6 years ago

@ebozduman PR is updated, can you please check

nitisht commented 6 years ago

@krisis I tested this on local Minio server, tests fail

Running with
SERVER_ENDPOINT: 127.0.0.1:9000
ACCESS_KEY:      DAJ4WPGPJGYFJ0QUI5EH
SECRET_KEY:      ***REDACTED***
ENABLE_HTTPS:    0
SERVER_REGION:   us-east-1
MINT_DATA_DIR:   /mint/data
MINT_MODE:       core
To get intermittent logs, 'sudo docker cp 2c9c70dadfe6:/mint/log /tmp/mint-logs'
Running aws-sdk-php tests ... FAILED in 1 seconds
{
  "name": "aws-sdk-php",
  "function": "getBucketPolicy ( array $params = [] )",
  "args": {
    "Bucket": "aws-sdk-php-bucket-34012"
  },
  "duration": "32",
  "status": "FAIL",
  "error": "Error executing \"PutObject\" on \"http://127.0.0.1:9000/aws-sdk-php-bucket-34012/test-anon\"; AWS HTTP error: Client error: `PUT http://127.0.0.1:9000/aws-sdk-php-bucket-34012/test-anon` resulted in a `404 Not Found` response:\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Mes (truncated...)\n NoSuchBucket (client): The specified bucket does not exist - <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Key></Key><BucketName></BucketName><Resource>/aws-sdk-php-bucket-34012/test-anon</Resource><RequestId>3L137</RequestId><HostId>3L137</HostId></Error>"
}
Finished running all tests.
To get logs, run 'sudo docker cp 2c9c70dadfe6:/mint/log /tmp/mint-logs'
nitisht commented 6 years ago

blocked till failure is resolved/clarified

krisis commented 6 years ago

@nitisht I have fixed the failure you observe on server, but this doesn't fix the issue on Azure gateway. @harshavardhana So far, only waiting 30s or more before creating a bucket just deleted, has been reliable. Thoughts?

harshavardhana commented 6 years ago

30s wait be fine we can revisit this..

deekoder commented 6 years ago

ok so is this ready to be merged.

krisis commented 6 years ago

@deekoder no, this PR isn't ready to be merged. As is it won't work with Minio gateway for Azure.

krisis commented 6 years ago

@nitisht @harshavardhana I have added an unconditional sleep to make mint aws-sdk-php functional tests run successfully on server and gateway (for Azure).

nitisht commented 6 years ago

@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.

ebozduman commented 6 years ago

This issue is marked blocked per @krisis , until we have a discussion.


From: Harshavardhana notifications@github.com This discussion starts from the question here #177, why do we need to add delays specifically for different gateways. This happens with Backblaze B2 for bucket policies in minio-java as well.

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 @ebozduman @harshavardhana this issue should be marked blocked until we have a discussion.