diff --git a/cmd/http/bufconn_test.go b/cmd/http/bufconn_test.go index f6a366c0e..f64b0985e 100644 --- a/cmd/http/bufconn_test.go +++ b/cmd/http/bufconn_test.go @@ -46,7 +46,8 @@ func TestBuffConnReadTimeout(t *testing.T) { tcpConn, terr := tcpListener.AcceptTCP() if terr != nil { - t.Fatalf("failed to accept new connection. %v", terr) + t.Errorf("failed to accept new connection. %v", terr) + return } bufconn := newBufConn(tcpConn, 1*time.Second, 1*time.Second) defer bufconn.Close() @@ -55,11 +56,13 @@ func TestBuffConnReadTimeout(t *testing.T) { var b = make([]byte, 12) _, terr = bufconn.Read(b) if terr != nil { - t.Fatalf("failed to read from client. %v", terr) + t.Errorf("failed to read from client. %v", terr) + return } received := string(b) if received != "message one\n" { - t.Fatalf(`server: expected: "message one\n", got: %v`, received) + t.Errorf(`server: expected: "message one\n", got: %v`, received) + return } // Wait for more than read timeout to simulate processing. @@ -67,17 +70,20 @@ func TestBuffConnReadTimeout(t *testing.T) { _, terr = bufconn.Read(b) if terr != nil { - t.Fatalf("failed to read from client. %v", terr) + t.Errorf("failed to read from client. %v", terr) + return } received = string(b) if received != "message two\n" { - t.Fatalf(`server: expected: "message two\n", got: %v`, received) + t.Errorf(`server: expected: "message two\n", got: %v`, received) + return } // Send a response. _, terr = io.WriteString(bufconn, "messages received\n") if terr != nil { - t.Fatalf("failed to write to client. %v", terr) + t.Errorf("failed to write to client. %v", terr) + return } // Removes all deadlines if any. diff --git a/cmd/namespace-lock_test.go b/cmd/namespace-lock_test.go index 54151cf44..6bd8c2eb3 100644 --- a/cmd/namespace-lock_test.go +++ b/cmd/namespace-lock_test.go @@ -218,7 +218,8 @@ func TestNamespaceForceUnlockTest(t *testing.T) { // Try to claim lock again. anotherLock := globalNSMutex.NewNSLock("bucket", "object") if anotherLock.GetLock(newDynamicTimeout(60*time.Second, time.Second)) != nil { - t.Fatalf("Failed to get lock") + t.Errorf("Failed to get lock") + return } // And signal success. ch <- struct{}{} diff --git a/cmd/object-handlers_test.go b/cmd/object-handlers_test.go index 4a146af79..7ca6924d2 100644 --- a/cmd/object-handlers_test.go +++ b/cmd/object-handlers_test.go @@ -2378,14 +2378,16 @@ func testAPINewMultipartHandlerParallel(obj ObjectLayer, instanceType, bucketNam req, err := newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, objectName), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { - t.Fatalf("Failed to create HTTP request for NewMultipart request: %v", err) + t.Errorf("Failed to create HTTP request for NewMultipart request: %v", err) + return } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to executes the registered handler. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != http.StatusOK { - t.Fatalf("Minio %s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusOK, rec.Code) + t.Errorf("Minio %s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusOK, rec.Code) + return } // decode the response body. decoder := xml.NewDecoder(rec.Body) @@ -2393,7 +2395,8 @@ func testAPINewMultipartHandlerParallel(obj ObjectLayer, instanceType, bucketNam err = decoder.Decode(multipartResponse) if err != nil { - t.Fatalf("Minio %s: Error decoding the recorded response Body", instanceType) + t.Errorf("Minio %s: Error decoding the recorded response Body", instanceType) + return } // push the obtained upload ID from the response into the array. testUploads.Lock() diff --git a/cmd/server_test.go b/cmd/server_test.go index 683fe4012..8806cc984 100644 --- a/cmd/server_test.go +++ b/cmd/server_test.go @@ -1046,7 +1046,8 @@ func (s *TestSuiteCommon) TestPutBucket(c *check) { client := http.Client{Transport: s.transport} response, err := client.Do(request) if err != nil { - c.Fatalf("Put bucket Failed: %s", err) + c.Errorf("Put bucket Failed: %s", err) + return } defer response.Body.Close() }() diff --git a/pkg/lock/lock_test.go b/pkg/lock/lock_test.go index abc8e71c3..cef9ec393 100644 --- a/pkg/lock/lock_test.go +++ b/pkg/lock/lock_test.go @@ -161,11 +161,13 @@ func TestLockAndUnlock(t *testing.T) { go func() { bl, blerr := LockedOpenFile(f.Name(), os.O_WRONLY, 0600) if blerr != nil { - t.Fatal(blerr) + t.Error(blerr) + return } locked <- struct{}{} if blerr = bl.Close(); blerr != nil { - t.Fatal(blerr) + t.Error(blerr) + return } }()