Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/deploy_ecs/tests/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def docker_context(test_id, monkeypatch, tmpdir):

# Use ecs --local-simulation
# https://docs.docker.com/cloud/ecs-integration/#local-simulation
subprocess.call(["docker", "context", "create", "ecs", "--local-simulation", test_id])
subprocess.run(["docker", "context", "create", "ecs", "--local-simulation", test_id], check=True)

yield test_id

subprocess.call(["docker", "context", "rm", test_id])
subprocess.run(["docker", "context", "rm", test_id], check=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 check=True in fixture teardown can mask real failures

Adding check=True to the cleanup call means a non-zero exit from docker context rm raises CalledProcessError during teardown, converting a normal test failure (or xfail) into a fixture ERROR. If the context can't be removed — e.g., because a prior test run left state behind and the test_id fixture still collides, or because the ECS local-simulation container is still running when teardown fires — the exception surfaces instead of (or alongside) the real test outcome. Teardown code should generally suppress or log errors rather than propagate them, so that cleanup failures don't obscure the actual failure being investigated.



@pytest.fixture
Expand Down