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:
Harshavardhana
2016-07-07 19:50:44 -07:00
committed by GitHub
parent 5ec7734d88
commit 4c21d6d09d
3 changed files with 6 additions and 63 deletions
+6 -6
View File
@@ -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 {