Revert "tests: Add context cancelation (#15374)"

This reverts commit 1e332f0eb1.

Reverting this as tests are failing randomly.
This commit is contained in:
Minio Trusted
2022-07-21 13:58:51 -07:00
parent 1e332f0eb1
commit 564a0afae1
22 changed files with 69 additions and 136 deletions
+2 -5
View File
@@ -19,7 +19,6 @@ package cmd
import (
"bytes"
"context"
"os"
"path/filepath"
"testing"
@@ -30,19 +29,17 @@ import (
// TestNewFS - tests initialization of all input disks
// and constructs a valid `FS` object layer.
func TestNewFS(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
// Do not attempt to create this path, the test validates
// so that NewFSObjectLayer initializes non existing paths
// and successfully returns initialized object layer.
disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
defer os.RemoveAll(disk)
_, err := NewFSObjectLayer(ctx, "")
_, err := NewFSObjectLayer("")
if err != errInvalidArgument {
t.Errorf("Expecting error invalid argument, got %s", err)
}
_, err = NewFSObjectLayer(ctx, disk)
_, err = NewFSObjectLayer(disk)
if err != nil {
errMsg := "Unable to recognize backend format, Disk is not in FS format."
if err.Error() == errMsg {