1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/testutil/daemon
Sebastiaan van Stijn c56bfdf10a
testutil/daemon: always remove pidfile after daemon is stopped
If the daemon was stopped successfully in one of the retry-loops,
the function would return early;

```go
for {
	select {
	case err := <-d.Wait:
---> the function returns here, both on "success" and on "fail"
		return err
	case <-time.After(20 * time.Second):
...
```

In that case, the pidfile would not be cleaned up. This patch changes
the function to clean-up the pidfile in a defer, so that it will
always be removed after succesfully stopping the daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-11 00:38:06 +02:00
..
config.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
container.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
daemon.go testutil/daemon: always remove pidfile after daemon is stopped 2019-10-11 00:38:06 +02:00
daemon_unix.go testutil/daemon: prefix all logs with daemon-id 2019-10-11 00:37:49 +02:00
daemon_windows.go testutil/daemon: prefix all logs with daemon-id 2019-10-11 00:37:49 +02:00
doc.go
node.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
ops.go testutil: update WithInitsignature to be a daemon.Option 2019-09-30 17:38:26 +02:00
plugin.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
secret.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
service.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00
swarm.go testutil: use testing.TB instead of assert.TestingT 2019-09-23 14:23:01 +02:00