fix(test): add missing .clone() in image_registries test after #604#606
Merged
DorianZheng merged 1 commit intoMay 27, 2026
Merged
Conversation
…e-ai#604 boxlite-ai#604 added `impl Drop for PerTestBoxHome` but missed updating `structured_image_registries_validate_at_runtime_start` — the rest of the file (line 14) and every other test file (e.g. shutdown.rs, 10+ sites) were updated to `home.path.clone()`, but line 40 still moves `home.path` directly, triggering E0509 on a Drop-implementing type. Reproduce on origin/main (2b9b545): $ cargo build --tests -p boxlite error[E0509]: cannot move out of type `PerTestBoxHome`, which implements the `Drop` trait --> src/boxlite/tests/image_registries.rs:40:19 After this change `cargo build --tests -p boxlite` compiles clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
G4614
pushed a commit
to G4614/boxlite
that referenced
this pull request
May 28, 2026
…check PR boxlite-ai#604 added a strict PerTestBoxHome::Drop assertion that fails if any shim referenced by <home>/boxes/*/shim.pid is still alive when the home drops. Two health_check tests tripped it: - health_check_transitions_to_healthy_after_startup: the box stays healthy; RuntimeImpl::Drop's safety-net shutdown_sync skips boxes that aren't plainly Running and does not reliably stop a box with an active health-check actor before the home's leak check fires. Add `t.bx.stop().await.ok()`. - health_check_becomes_unhealthy_when_shim_killed: the test kill -9's the shim, leaving a zombie (dead, unreaped while the runtime parent lives). The leak check counts zombies as live (kill(pid,0)==0), and the now-Stopped box is skipped by shutdown_sync, so nothing reaps it. Add `t.runtime.remove(box_id, true).await.ok()` which reaps the child. Test-only change. The box already reports Stopped correctly; only the test-side cleanup was missing. The production safety-net gap is noted in the comments but left unchanged to avoid unprompted scope creep. (image_registries.rs .clone() compile fix dropped from this branch — upstream boxlite-ai#606 landed the same fix; rebased onto current main.) Two-side verified: pre-fix: 2 tests run: 0 passed, 2 failed (both "PerTestBoxHome dropped with 1 live shim") post-fix: 2 tests run: 2 passed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
#604 added `impl Drop for PerTestBoxHome` but missed one site. Line 40 still moves `home.path` directly, triggering E0509 on every `cargo build --tests -p boxlite` on current main.
Reproduce on origin/main (2b9b545):
```
$ cargo build --tests -p boxlite
error[E0509]: cannot move out of type `PerTestBoxHome`, which implements the `Drop` trait
--> src/boxlite/tests/image_registries.rs:40:19
```
Same file's line 14 and every other test file (e.g. `shutdown.rs`, 10+ sites) was already updated to `home.path.clone()`; this is the one site sed/find-replace skipped.
After this change `cargo build --tests -p boxlite` compiles clean.