1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/testutil
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
..
daemon testutil/daemon: always remove pidfile after daemon is stopped 2019-10-11 00:38:06 +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
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
helper.go
helpers.go
stringutils.go
stringutils_test.go