Browse Source

Check if bucket exists before attempting to delete it

If you attempt to delete a bucket if it does not exist, the API returns a `404` for the not existent bucket, which is correct. So before the attempt to remove the bucket, there should be a check if it even exists.

This test-bug was introduced in commit 9772a373b9, which also disabled the error handling for all requests - which is the reason this bug was not discovered so far.
pull/1083/head
Stephan Bade Ing 1 year ago
committed by ebozduman
parent
commit
424299ec0e
  1. 6
      Minio.Functional.Tests/FunctionalTest.cs

6
Minio.Functional.Tests/FunctionalTest.cs

@ -364,7 +364,11 @@ public static class FunctionalTest
try
{
await minio.RemoveBucketAsync(rbArgs).ConfigureAwait(false);
if (await minio.BucketExistsAsync(beArgs).ConfigureAwait(false))
{
await minio.RemoveBucketAsync(rbArgs).ConfigureAwait(false);
}
var found = await minio.BucketExistsAsync(beArgs).ConfigureAwait(false);
Assert.IsFalse(found);
await minio.MakeBucketAsync(mbArgs).ConfigureAwait(false);

Loading…
Cancel
Save