fix(dolt): refetch container in setup retry loop#140
Merged
Conversation
`_provide_dolt_service` cached a container handle from `_get_container` above its retry loop. Under parallel xdist with `transient=True`, `docker_service.run` returns success but the container can be auto-removed (Docker `remove=True` + a brief Dolt startup blip) between the readiness check passing and the post-`run` setup `exec_run`. Every retry then 404s against the same stale ID and the fixture silently yields a broken service, surfacing later as `docker.errors.NotFound` at test setup. - Refetch the container by name inside the loop. - Tolerate `NotFound` and 404/409 `APIError` so a vanished container re-tries cleanly instead of bubbling up. - Replace the previous silent-skip-on-missing-container path with an explicit `RuntimeError` after 5 attempts so a genuinely dead container fails fixture setup loudly instead of producing a half-baked service. Surfaced as the recurring `test_xdist_isolate_server` flake in CI on the open clientless PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_provide_dolt_servicecached a container handle from_get_containerabove its retry loop. Under parallel xdist withtransient=True,docker_service.runreturns success but the container can be auto-removed (Dockerremove=Trueplus a brief Dolt startup blip) between the readiness check passing and the post-runsetupexec_run. Every retry then 404s against the same stale ID and the fixture silently yields a broken service, surfacing later asdocker.errors.NotFoundat test setup.This recurring flake has hit `tests/test_dolt.py::test_xdist_isolate_server` on the open clientless PRs (e.g. valkey #138 Python 3.11 - 1/3).
Changes
Test plan