Skip to content

test(e2e): CLI-first cleanup with complete docker fallback - #268

Merged
zheli merged 1 commit into
mainfrom
test/e2e-cli-first-cleanup
Jul 12, 2026
Merged

test(e2e): CLI-first cleanup with complete docker fallback#268
zheli merged 1 commit into
mainfrom
test/e2e-cli-first-cleanup

Conversation

@zheli

@zheli zheli commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

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 --volumes only removes volumes Compose itself created. The restore path (snapshot.go docker run -v <vol>:...) re-creates the postgres volume 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 for canton-<name> still exist.
  • e2e_force_docker_cleanup -- compose down --volumes --remove-orphans plus a name-prefix docker volume rm -f sweep so detached/external volumes are also removed.
  • e2e_cleanup_instance -- always runs canton-devkit remove first; only falls back to docker when remove fails or resources remain.
  • Rewired lib.sh cleanup, m1-snp-001, m1-up-002, and both m1-rmv-001 failure branches.

Behavior

  1. Always canton-devkit remove first; docker fallback is optional (only when needed).
  2. When the docker fallback runs, it removes everything -- no detached volumes.

Notes

Scope is scripts only (per request). The underlying product remove/clean gap (it also relies on compose down --volumes and 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 -n passes on all scripts/e2e/*.sh (matches the Static Analysis workflow).
  • shellcheck: no new findings in changed code (pre-existing SC2034/SC1091 only).

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.
@zheli
zheli merged commit de6f32e into main Jul 12, 2026
1 check passed
@zheli
zheli deleted the test/e2e-cli-first-cleanup branch July 12, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant