chore: improve dagster maintenance path#33884
Conversation
Greptile SummaryThis PR replaces two
Confidence Score: 3/5The teardown call gains Using examples/deploy_ecs/tests/test_deploy.py — specifically the
|
| Filename | Overview |
|---|---|
| examples/deploy_ecs/tests/test_deploy.py | Replaces subprocess.call with subprocess.run(..., check=True) in the docker_context fixture; check=True on the teardown (rm) call can raise CalledProcessError during cleanup, masking the actual test outcome. |
Sequence Diagram
sequenceDiagram
participant pytest
participant docker_context fixture
participant subprocess
pytest->>docker_context fixture: setup
docker_context fixture->>subprocess: run(["docker","context","create",...], check=True)
alt create fails (non-zero exit)
subprocess-->>docker_context fixture: CalledProcessError
docker_context fixture-->>pytest: fixture setup ERROR (teardown skipped)
else create succeeds
subprocess-->>docker_context fixture: CompletedProcess(returncode=0)
docker_context fixture-->>pytest: yield test_id
pytest->>pytest: run test (xfail)
pytest->>docker_context fixture: teardown
docker_context fixture->>subprocess: run(["docker","context","rm",...], check=True)
alt rm fails (non-zero exit)
subprocess-->>docker_context fixture: CalledProcessError
docker_context fixture-->>pytest: fixture teardown ERROR (masks original test result)
else rm succeeds
subprocess-->>docker_context fixture: CompletedProcess(returncode=0)
docker_context fixture-->>pytest: teardown complete
end
end
Reviews (1): Last reviewed commit: "chore: improve dagster maintenance path" | Re-trigger Greptile
| yield test_id | ||
|
|
||
| subprocess.call(["docker", "context", "rm", test_id]) | ||
| subprocess.run(["docker", "context", "rm", test_id], check=True) |
There was a problem hiding this comment.
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.
Summary:
Notes: