moby/testutil
Sebastiaan van Stijn b843b1ffe3
testutil/daemon: store pidfile-path, and ignore errors when removing
This patch stores the location of the pidfile, so that we can use the
same path that was set to create it. If no pidfile was created, we'll
not try to remove it.

We're now also ignoring errors when removing the pidfile, as they should
not fail the test (especialy if no pidfile was created in the first place,
as that could potentially hide the actual failure).

This may help with "failures" such as the one below:

```
FAIL: check_test.go:347: DockerSwarmSuite.TearDownTest

check_test.go:352:
    d.Stop(c)
/go/src/github.com/docker/docker/internal/test/daemon/daemon.go:414:
    t.Fatalf("Error while stopping the daemon %s : %v", d.id, err)
... Error: Error while stopping the daemon d1512c423813a : remove /go/src/github.com/docker/docker/bundles/test-integration/DockerSwarmSuite.TestServiceLogs/d1512c423813a/docker.pid: no such file or directory
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-11 00:38:02 +02:00
..
daemon testutil/daemon: store pidfile-path, and ignore errors when removing 2019-10-11 00:38:02 +02:00
environment testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
fakecontext Remove some uses of testutil.HelperT 2019-09-23 14:06:27 +02:00
fakegit Remove some uses of testutil.HelperT 2019-09-23 14:06:27 +02:00
fakestorage Remove some uses of testutil.HelperT 2019-09-23 14:06:27 +02:00
fixtures testutil: make testing packages public 2019-09-11 07:47:23 -05:00
registry testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
request testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
doc.go testutil: make testing packages public 2019-09-11 07:47:23 -05:00
helper.go testutil: make testing packages public 2019-09-11 07:47:23 -05:00
helpers.go testutil: make testing packages public 2019-09-11 07:47:23 -05:00
stringutils.go testutil: make testing packages public 2019-09-11 07:47:23 -05:00
stringutils_test.go testutil: make testing packages public 2019-09-11 07:47:23 -05:00