test(e2e): CLI-first cleanup with complete docker fallback - #268
Merged
Conversation
Cleanup helpers unconditionally ran `docker compose down --volumes` after `canton-devkit remove`, and that fallback left detached volumes behind (compose down only removes volumes it created; the restore path re-creates the postgres volume out of band via `docker run -v`, so it is adopted as external and skipped) -- the leak that trips M1-RMV-001. - Always use `canton-devkit remove` first; only fall back to docker when remove fails or resources actually remain (e2e_cleanup_instance + e2e_instance_resources_remain). - When the docker fallback does run, remove everything including detached volumes via a name-prefix `docker volume rm -f` sweep (e2e_force_docker_cleanup). - Rewire lib.sh cleanup, m1-snp-001, m1-up-002, and m1-rmv-001 fallbacks.
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
Makes the Milestone 1 E2E cleanup CLI-first and ensures the docker fallback removes everything (no detached volumes left behind).
Motivated by the M1-CLN-001/M1-RMV-001 CI failure (
FAIL step 3b: volumes remain after clean). Root cause:docker compose down --volumesonly removes volumes Compose itself created. The restore path (snapshot.godocker run -v <vol>:...) re-creates thepostgresvolume out of band, so Compose adopts it as external and skips it on teardown -- leaving a detached volume that trips the "volumes remain" assertion.Changes
e2e_instance_resources_remain-- true only when containers/volumes/networks forcanton-<name>still exist.e2e_force_docker_cleanup--compose down --volumes --remove-orphansplus a name-prefixdocker volume rm -fsweep so detached/external volumes are also removed.e2e_cleanup_instance-- always runscanton-devkit removefirst; only falls back to docker when remove fails or resources remain.lib.shcleanup,m1-snp-001,m1-up-002, and bothm1-rmv-001failure branches.Behavior
canton-devkit removefirst; docker fallback is optional (only when needed).Notes
Scope is scripts only (per request). The underlying product
remove/cleangap (it also relies oncompose down --volumesand cannot reclaim externally-adopted volumes) is not fixed here, so M1-RMV-001's own assertion -- which intentionally has no fallback -- may still surface that bug until the Go path is fixed separately.Test
bash -npasses on allscripts/e2e/*.sh(matches the Static Analysis workflow).