Browse code

Ignore socket rm errors on daemon suite teardown

Errors here are not important and not really related to set success/failure.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2016/08/11 04:18:35
Showing 1 changed files
... ...
@@ -9,7 +9,6 @@ import (
9 9
 	"testing"
10 10
 
11 11
 	"github.com/docker/docker/cliconfig"
12
-	"github.com/docker/docker/pkg/integration/checker"
13 12
 	"github.com/docker/docker/pkg/reexec"
14 13
 	"github.com/docker/engine-api/types/swarm"
15 14
 	"github.com/go-check/check"
... ...
@@ -189,18 +188,18 @@ func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
189 189
 }
190 190
 
191 191
 func (s *DockerDaemonSuite) TearDownSuite(c *check.C) {
192
-	err := filepath.Walk(daemonSockRoot, func(path string, fi os.FileInfo, err error) error {
192
+	filepath.Walk(daemonSockRoot, func(path string, fi os.FileInfo, err error) error {
193 193
 		if err != nil {
194
-			return err
194
+			// ignore errors here
195
+			// not cleaning up sockets is not really an error
196
+			return nil
195 197
 		}
196 198
 		if fi.Mode() == os.ModeSocket {
197 199
 			syscall.Unlink(path)
198 200
 		}
199 201
 		return nil
200 202
 	})
201
-	c.Assert(err, checker.IsNil, check.Commentf("error while cleaning up daemon sockets"))
202
-	err = os.RemoveAll(daemonSockRoot)
203
-	c.Assert(err, checker.IsNil, check.Commentf("could not cleanup daemon socket root"))
203
+	os.RemoveAll(daemonSockRoot)
204 204
 }
205 205
 
206 206
 const defaultSwarmPort = 2477