Skip to content

Fix ETXTBSY flake in container-engine image tests - #164

Merged
Ibrahimrahhal merged 1 commit into
mainfrom
cursor/fix-image-etxtbsy-c919
Aug 26, 2026
Merged

Fix ETXTBSY flake in container-engine image tests#164
Ibrahimrahhal merged 1 commit into
mainfrom
cursor/fix-image-etxtbsy-c919

Conversation

@Ibrahimrahhal

Copy link
Copy Markdown
Member

The rust-tests CI job flakes on images::tests::save_images_separates_references_differing_only_in_case with:

Failed to run `.../stub-engine.sh image inspect myapp:v1`: Text file busy (os error 26)

That test (and the stub engine it execs) landed in #153 (corgea scan --include-image). The helper wrote stub-engine.sh in place and exec’d it immediately. On GitHub Actions overlayfs, under cargo-llvm-cov, that races with ETXTBSY.

This change is test-only:

  • Write the stub via fsync + rename so exec cannot race an open writer
  • Wait until the script is actually executable
  • Give each test a unique temp dir instead of a pid-scoped path

Split out of the MCP install work so that PR stays scoped to corgea mcp install.

Open in Web Open in Cursor 

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>
@Ibrahimrahhal
Ibrahimrahhal marked this pull request as ready for review August 26, 2026 11:45

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Automation: pr-flow

Comment thread src/images.rs
.prefix(&format!("corgea-images-test-{name}-"))
.tempdir()
.expect("temp dir")
.keep()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 corgea-security left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 corgea-security added the dennis-reviewed Dennis completed an automated review label Aug 26, 2026

@corgea-security corgea-security left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by Dennis: high policy risk and automated risk 2/5.

@Ibrahimrahhal
Ibrahimrahhal merged commit 185ff38 into main Aug 26, 2026
20 checks passed
@Ibrahimrahhal
Ibrahimrahhal deleted the cursor/fix-image-etxtbsy-c919 branch August 26, 2026 12:04
cursor Bot pushed a commit that referenced this pull request Aug 26, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dennis-reviewed Dennis completed an automated review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants