mirror of
https://github.com/pgsty/minio.git
synced 2026-07-16 00:41:25 +03:00
tests: Remove racey failedDisks behavior in RenameObject tests. (#2138)
Additionally also initialize namespace lock only once per test run, there is no reason to initialize it multiple times to avoid races. Fixes #2137
This commit is contained in:
+6
-6
@@ -40,6 +40,12 @@ import (
|
||||
router "github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
// Tests should initNSLock only once.
|
||||
func init() {
|
||||
// Initialize name space lock.
|
||||
initNSLock()
|
||||
}
|
||||
|
||||
// The Argument to TestServer should satidy the interface.
|
||||
// Golang Testing.T and Testing.B, and gocheck.C satisfy the interface.
|
||||
// This makes it easy to run the TestServer from any of the tests.
|
||||
@@ -554,9 +560,6 @@ func getXLObjectLayer() (ObjectLayer, []string, error) {
|
||||
erasureDisks = append(erasureDisks, path)
|
||||
}
|
||||
|
||||
// Initialize name space lock.
|
||||
initNSLock()
|
||||
|
||||
objLayer, err := newXLObjects(erasureDisks)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@@ -572,9 +575,6 @@ func getSingleNodeObjectLayer() (ObjectLayer, string, error) {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
// Initialize name space lock.
|
||||
initNSLock()
|
||||
|
||||
// Create the obj.
|
||||
objLayer, err := newFSObjects(fsDir)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user