Currently it doesn't actually seem to make any practical difference that this
is missing, but it seems like good practice to do so anyway, to be robust
against future test case changes which might require cleanup done in the super
class.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Each volume in the array holds a reference to a docker.client.Client object and
therefore a connection pool which leaves fds open once the test has completed.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
These hold a reference to a docker.client.Client object and therefore a
connection pool which leaves fds open once the test has completed.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This is a docker.client.Client and therefore contains a connection pool, so
each subclass of DockerClientTestCase can end up holding on to up to 10 Unix
socket file descriptors after the tests contained in the sub-class are
complete.
Before this by the end of a test run I was seeing ~100 open file descriptors,
~80 of which were Unix domain sockets. By cleaning these up only 15 Unix
sockets remain at the end (out of ~25 fds, the rest of which are the Python
interpretter, opened libraries etc).
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
self._project.client is a docker.client.Client, so creating a new self._project
leaks (via the embedded connection pool) a bunch of Unix socket file
descriptors for each test which overrides self.project using this mechanism.
In my tests I observed the test harness using 800-900 file descriptor, which is
OK on Linux with the default limit of 1024 but breaks on OSX (e.g. with
Docker4Mac) where the default limit is only 256. The failure can be provoked on
Linux too with `ulimit -n 256`.
With this fix I have observed the process ending with ~100 file descriptors
open, including 83 Unix sockets, so I think there is likely at least one more
leak lurking.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Add note to say that environment variables will not be automatically
made available at build time, and point to the `args` documentation.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
- When no command is passed but `--entrypoint` is, set Cmd to `[]`
- When command is a single empty string, set Cmd to `[""]`
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Unset env vars passed to `run` via command line options take the
value of the system's var with the same name.
Signed-off-by: Joffrey F <joffrey@docker.com>