Fix ETXTBSY flake in container-engine image tests - #164
Conversation
CI under cargo-llvm-cov failed save_images_separates_references_differing_only_in_case with "Text file busy" when execing a stub script that had just been written in place. Write the stub via fsync+rename, wait until it is executable, and give each test a unique temp dir. Co-authored-by: Ibrahim Rahhal <ibrahim.rahhal3636@gmail.com>
There was a problem hiding this comment.
No actionable findings. I verified the change remains test-only, the stub writer is closed before chmod/rename and the warm-up command waits for process completion, unique temporary directories prevent concurrent test-path reuse, and the Unix gating remains correct. ./harness lint, the full 750-test suite, 50 consecutive runs of the previously flaky case-collision test, and the CI-equivalent cargo llvm-cov --summary-only --fail-under-lines 13 run all passed; the PR's rust-tests and platform build checks also passed.
Sent by Cursor Automation: pr-flow
| .prefix(&format!("corgea-images-test-{name}-")) | ||
| .tempdir() | ||
| .expect("temp dir") | ||
| .keep() |
There was a problem hiding this comment.
nitpick: Unique temporary directories are never removed
Calling TempDir::keep() disables RAII cleanup. Unlike the previous stable per-process path, every helper invocation now leaves a uniquely named directory behind, causing persistent accumulation on developer machines. Return and retain the TempDir guard, or explicitly remove the directory after each test.
Proof or reproduction:
let dir = tempfile::Builder::new().tempdir().unwrap();
let path = dir.path().to_path_buf();
// Keep `dir` alive for the test; dropping it performs cleanup.
corgea-security
left a comment
There was a problem hiding this comment.
Automated review risk: 2/5.
Low-risk, test-only change. No blocking correctness issues found; one cleanup concern remains.
No critical or high-priority changes were found.
corgea-security
left a comment
There was a problem hiding this comment.
Approved by Dennis: high policy risk and automated risk 2/5.
Bring in the merged ETXTBSY image-test fix (#164) so this PR's CI can pass without any further MCP-branch changes. Co-authored-by: Ibrahim Rahhal <ibrahim.rahhal3636@gmail.com>


The rust-tests CI job flakes on
images::tests::save_images_separates_references_differing_only_in_casewith:That test (and the stub engine it execs) landed in #153 (
corgea scan --include-image). The helper wrotestub-engine.shin place and exec’d it immediately. On GitHub Actions overlayfs, undercargo-llvm-cov, that races withETXTBSY.This change is test-only:
Split out of the MCP install work so that PR stays scoped to
corgea mcp install.