From cb9ee1584a99fc9f6552bbd7a94556ca9b483d97 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 12 Jun 2018 16:36:31 -0700 Subject: [PATCH] Fix TestHealStartNStatusHandler sporadic failure (#6015) Fixes #5818 --- cmd/posix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/posix.go b/cmd/posix.go index a9e41545d..a56355591 100644 --- a/cmd/posix.go +++ b/cmd/posix.go @@ -135,10 +135,10 @@ func getValidPath(path string) (string, error) { if err != nil { return path, err } + defer os.Remove(pathJoin(path, ".writable-check.tmp")) file.Close() - err = os.Remove(pathJoin(path, ".writable-check.tmp")) - return path, err + return path, nil } // isDirEmpty - returns whether given directory is empty or not.