Skip to content

Docker containers used in tests are not removed #20153

@daniel-westerfeld

Description

@daniel-westerfeld

Describe the bug
Docker containers used to run tests in are not cleaned up. To be concrete, in the BUILD file of my test folder I have:

python_tests(
    environment="test_docker_environment",
)

and in the parent folder the environment is defined

docker_environment(
    name="local_test_environment",
    image="image_sha",
)

and in my pants.toml I have added

[environments-preview.names]
test_docker_environment = "//parent/folder:local_test_environment"
local = "//:local-environment"

This all works fine and using pants test :: the test runs successfully in its own docker container.
However, the container remains after the tests and is not removed and remains active.

Pants version
2.16.0

OS
Are you encountering the bug on MacOS, Linux, or both?
Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions