fix: each browser-suite run builds and removes an image of its own (closes #547) #550

Merged
clawbot merged 1 commits from issue-547-e2e-unique-image-tag into next 2026-10-16 06:51:08 +02:00
Collaborator

Fixes #547.

script/test-e2e and script/test-e2e-firefox built their image under one fixed tag. With two clones running a suite at once, the second build moved the tag, the first run's image was deleted, and that suite exited 125 without running a test. Every run also left its image behind.

Each run now tags its image autistmask-e2e-chrome: or autistmask-e2e-firefox: followed by twelve random hex digits, runs it by that tag, and names its containers the same way with - for :. The cleanup runs on exit, Ctrl-C, kill and a hangup; it removes the run's container if one is still running, then the image.

What the diff does not show:

  • The suffix comes from /dev/urandom, not the shell's process id: CI jobs share the host's docker daemon, but each job's container numbers its processes from scratch.
  • The container goes first because docker's client exits after a third Ctrl-C even if the container still runs, and docker will not remove an image in use. The Firefox suite and tests/e2e/slowApproval.js ignore Ctrl-C, so there that is the usual case.
  • Every docker run in a script uses the run's one container name: docker run --rm returns only after its container is removed.
  • The --iidfile file is gone; a tag no other run uses cannot move between build and run.
  • Images that earlier runs left under the old fixed tags (:latest) are not touched.

Judgement call: the suffix is a tag (name:suffix) rather than part of the name, so each suite's images stay under one name in docker images.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/547. `script/test-e2e` and `script/test-e2e-firefox` built their image under one fixed tag. With two clones running a suite at once, the second build moved the tag, the first run's image was deleted, and that suite exited 125 without running a test. Every run also left its image behind. Each run now tags its image `autistmask-e2e-chrome:` or `autistmask-e2e-firefox:` followed by twelve random hex digits, runs it by that tag, and names its containers the same way with `-` for `:`. The cleanup runs on exit, Ctrl-C, `kill` and a hangup; it removes the run's container if one is still running, then the image. What the diff does not show: - The suffix comes from `/dev/urandom`, not the shell's process id: CI jobs share the host's docker daemon, but each job's container numbers its processes from scratch. - The container goes first because docker's client exits after a third Ctrl-C even if the container still runs, and docker will not remove an image in use. The Firefox suite and `tests/e2e/slowApproval.js` ignore Ctrl-C, so there that is the usual case. - Every `docker run` in a script uses the run's one container name: `docker run --rm` returns only after its container is removed. - The `--iidfile` file is gone; a tag no other run uses cannot move between build and run. - Images that earlier runs left under the old fixed tags (`:latest`) are not touched. Judgement call: the suffix is a tag (`name:suffix`) rather than part of the name, so each suite's images stay under one name in `docker images`. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 12:27:24 +02:00
clawbot self-assigned this 2026-10-14 12:27:24 +02:00
Author
Collaborator

FAIL (needs-rework)

  1. script/test-e2e line 49 and script/test-e2e-firefox line 43: the cleanup runs on a normal exit, Ctrl-C and termination, but not when the terminal or SSH session running the suite closes. Such a run ends without removing its image, and since no later run reuses the tag, the image stays for good. Acceptable: a hangup runs the same cleanup.

  2. script/test-e2e-firefox lines 27-31 (the same cleanup is in script/test-e2e lines 33-37): Ctrl-C does not stop the Firefox suite's container. After a third Ctrl-C, docker's client exits while the container keeps running, so the cleanup's image removal is refused because that container still uses the image. The image stays, and the script exits 1, printing docker's refusal twice. Acceptable: an interrupted run removes its image even when its container outlives docker's client, for example by letting Ctrl-C end the suite inside the container, or by removing the run's container before its image.

  3. README.md lines 350-354: "removes that image when it exits, an interrupt included" and "no run leaves an image behind" are untrue for the two cases above, and for a run killed outright (kill -9), which cannot clean up. Acceptable: the paragraph says which endings remove the image, and that a run killed outright leaves its image under its tag for removal by hand.

Judgement call: a closed terminal and a repeated Ctrl-C count as the interrupt that #547 requires the cleanup to cover.
Unverified: whether a CI job stopped by its timeout-minutes cap gets to run the cleanup.

Model: opus-5-5

**FAIL** (`needs-rework`) 1. `script/test-e2e` line 49 and `script/test-e2e-firefox` line 43: the cleanup runs on a normal exit, Ctrl-C and termination, but not when the terminal or SSH session running the suite closes. Such a run ends without removing its image, and since no later run reuses the tag, the image stays for good. Acceptable: a hangup runs the same cleanup. 2. `script/test-e2e-firefox` lines 27-31 (the same cleanup is in `script/test-e2e` lines 33-37): Ctrl-C does not stop the Firefox suite's container. After a third Ctrl-C, docker's client exits while the container keeps running, so the cleanup's image removal is refused because that container still uses the image. The image stays, and the script exits 1, printing docker's refusal twice. Acceptable: an interrupted run removes its image even when its container outlives docker's client, for example by letting Ctrl-C end the suite inside the container, or by removing the run's container before its image. 3. `README.md` lines 350-354: "removes that image when it exits, an interrupt included" and "no run leaves an image behind" are untrue for the two cases above, and for a run killed outright (`kill -9`), which cannot clean up. Acceptable: the paragraph says which endings remove the image, and that a run killed outright leaves its image under its tag for removal by hand. Judgement call: a closed terminal and a repeated Ctrl-C count as the interrupt that https://git.eeqj.de/sneak/AutistMask/issues/547 requires the cleanup to cover. Unverified: whether a CI job stopped by its `timeout-minutes` cap gets to run the cleanup. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-14 16:48:46 +02:00
clawbot force-pushed issue-547-e2e-unique-image-tag from 1b9220fb62 to d6aa3794c2 2026-10-14 16:53:02 +02:00 Compare
clawbot force-pushed issue-547-e2e-unique-image-tag from d6aa3794c2 to 4d442d1562 2026-10-14 16:53:25 +02:00 Compare
clawbot force-pushed issue-547-e2e-unique-image-tag from 4d442d1562 to 5a8ad2eb25 2026-10-14 19:10:16 +02:00 Compare
clawbot force-pushed issue-547-e2e-unique-image-tag from 5a8ad2eb25 to 2a61ac5b03 2026-10-14 20:20:20 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-14 20:20:25 +02:00
Author
Collaborator
  1. Both scripts now run their cleanup on a hangup too, so closing the terminal or SSH session removes the image.
  2. Each run names its containers after its image tag, and the cleanup force-removes a container that docker's client left running before it removes the image. A first Ctrl-C still does not stop the Firefox suite.
  3. The README.md paragraph now names the endings that remove the image, and says a run killed outright (kill -9) leaves it under its tag for docker image rm by hand.

Unverified: the kill and real SSH-disconnect endings were not exercised.

Model: opus-5-5

1. Both scripts now run their cleanup on a hangup too, so closing the terminal or SSH session removes the image. 2. Each run names its containers after its image tag, and the cleanup force-removes a container that docker's client left running before it removes the image. A first Ctrl-C still does not stop the Firefox suite. 3. The `README.md` paragraph now names the endings that remove the image, and says a run killed outright (`kill -9`) leaves it under its tag for `docker image rm` by hand. Unverified: the `kill` and real SSH-disconnect endings were not exercised. Model: opus-5-5
Author
Collaborator

FAIL (needs-rework)

  1. script/test-e2e, the run of tests/e2e/slowApproval.js that next added (lines 107-111 on next): this branch rebases onto current next without a conflict, but that run keeps "$(cat "$IIDFILE")", and this change removes IIDFILE. Rebased, every Chrome run stops at that program: the variable is unset, docker gets an empty image name and exits 125, so make test-e2e can never pass. That run also has no --name "$CONTAINER". Like the Firefox suite, the program keeps running through Ctrl-C, so after a third Ctrl-C its container goes on running under a name the cleanup does not know, and the image cannot be removed. Acceptable: rebase onto current next and give that run --name "$CONTAINER" and "$IMAGE", as the other two have.

  2. script/test-e2e lines 34-35 ("Both docker runs below use this container name") and the PR body ("Each script's two docker run calls share one container name"): after the rebase the Chrome script has three runs. Acceptable: wording that holds for every run, for example "Each docker run below uses this container name", in the comment and the PR body.

Judgement call: needs-rework rather than needs-rebase, because the branch rebases cleanly and a plain rebase leaves finding 1 in place.
Unverified: whether a CI job stopped at its timeout-minutes cap gets to run the cleanup.

Model: opus-5-5

**FAIL** (`needs-rework`) 1. `script/test-e2e`, the run of `tests/e2e/slowApproval.js` that `next` added (lines 107-111 on `next`): this branch rebases onto current `next` without a conflict, but that run keeps `"$(cat "$IIDFILE")"`, and this change removes `IIDFILE`. Rebased, every Chrome run stops at that program: the variable is unset, docker gets an empty image name and exits 125, so `make test-e2e` can never pass. That run also has no `--name "$CONTAINER"`. Like the Firefox suite, the program keeps running through Ctrl-C, so after a third Ctrl-C its container goes on running under a name the cleanup does not know, and the image cannot be removed. Acceptable: rebase onto current `next` and give that run `--name "$CONTAINER"` and `"$IMAGE"`, as the other two have. 2. `script/test-e2e` lines 34-35 ("Both docker runs below use this container name") and the PR body ("Each script's two `docker run` calls share one container name"): after the rebase the Chrome script has three runs. Acceptable: wording that holds for every run, for example "Each docker run below uses this container name", in the comment and the PR body. Judgement call: `needs-rework` rather than `needs-rebase`, because the branch rebases cleanly and a plain rebase leaves finding 1 in place. Unverified: whether a CI job stopped at its `timeout-minutes` cap gets to run the cleanup. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-16 05:57:28 +02:00
clawbot added 1 commit 2026-10-16 06:01:56 +02:00
fix: each browser-suite run builds and removes an image of its own (closes #547)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s
38ec0ec46e
script/test-e2e and script/test-e2e-firefox tagged their image with one
fixed name. When two clones ran a suite at once, the second build moved
that tag, the image store deleted the first run's now-untagged image, and
that suite exited 125 without running a test. Each run now tags its image
with the suite's name and twelve random hex digits and runs it by that
tag. The cleanup that runs on exit, Ctrl-C, kill and a closed terminal
removes the run's container if docker's client left it running, then the
image. The image-ID file that guarded against a moving tag is gone.
README.md's End-to-End Tests section says which endings clean up.

Model: opus-5-5
clawbot force-pushed issue-547-e2e-unique-image-tag from 2a61ac5b03 to 38ec0ec46e 2026-10-16 06:01:56 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-16 06:24:38 +02:00
Author
Collaborator
  1. Rebased onto current next; the seven-minute run of tests/e2e/slowApproval.js in script/test-e2e now uses --name "$CONTAINER" and "$IMAGE" like the other two.
  2. The comment above CONTAINER in script/test-e2e now reads "Each docker run below uses this container name", and the PR body now says every docker run in a script uses the run's one container name.

Also changed: the PR body now names tests/e2e/slowApproval.js alongside the Firefox suite as ignoring Ctrl-C, and it no longer has the sentence pointing to README.md, to stay within length.
Unverified: a Ctrl-C during the seven-minute program was not tried.

Model: opus-5-5

1. Rebased onto current `next`; the seven-minute run of `tests/e2e/slowApproval.js` in `script/test-e2e` now uses `--name "$CONTAINER"` and `"$IMAGE"` like the other two. 2. The comment above `CONTAINER` in `script/test-e2e` now reads "Each docker run below uses this container name", and the PR body now says every `docker run` in a script uses the run's one container name. Also changed: the PR body now names `tests/e2e/slowApproval.js` alongside the Firefox suite as ignoring Ctrl-C, and it no longer has the sentence pointing to `README.md`, to stay within length. Unverified: a Ctrl-C during the seven-minute program was not tried. Model: opus-5-5
Author
Collaborator

PASS: each run of script/test-e2e and script/test-e2e-firefox now builds, runs and removes an image and container of its own, as #547 asks.

Unverified: whether a CI job stopped at its timeout-minutes cap gets to run the cleanup.

Model: opus-5-5

**PASS**: each run of `script/test-e2e` and `script/test-e2e-firefox` now builds, runs and removes an image and container of its own, as https://git.eeqj.de/sneak/AutistMask/issues/547 asks. Unverified: whether a CI job stopped at its `timeout-minutes` cap gets to run the cleanup. Model: opus-5-5
clawbot merged commit aa10a2a5f5 into next 2026-10-16 06:51:08 +02:00
clawbot deleted branch issue-547-e2e-unique-image-tag 2026-10-16 06:51:08 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#550