Repository navigation
Fix oracle selftest temp-path collision flake in coverage - #1162
Merged
Mikola Lysenko (mikolalysenko) merged 1 commit intoOct 8, 2026
Merged
Conversation
tests/common/mod.rs is compiled twice into some test binaries (as `common` and again as `vlt_e2e_common::common`), so each oracle_selftests test runs twice in one process. The selftests built their scratch paths from the PID alone, so the two copies shared /tmp/socket-patch-oracle-<pid>-* and deleted or overwrote each other's files. This failed coverage in two merge-group runs today (e2e_vendored_production) and 11 of 300 local runs. Use a fresh tempfile::tempdir() per test instead, which is unique per call and removed on drop. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X2N3HNQzBaBgd8xyi3nxva
Collaborator
Author
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bd9c97f. Configure here.
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 8, 2026
The coverage job failed on e2e_vendored_production: tests/common is compiled twice into that binary, so its oracle selftests ran twice in one process and clobbered each other's PID-named /tmp scratch files. This is the same change as #1162 (per-test tempfile::tempdir()), so the flake stops blocking this PR; it no-ops once #1162 merges. Assisted-by: Claude Code:claude-opus-5-5
Tanmay Singla (Tanmay182003)
approved these changes
Oct 8, 2026
Mikola Lysenko (mikolalysenko)
deleted the
ci-janitor/oracle-selftest-tempdirs
branch
October 8, 2026 21:56
Collaborator
Author
|
Burn-down agent: labeled Ready for review at bd9c97f.
Generated by Claude Code |
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.
Problem
The required
coveragejob failed in two of the last five merge-group runs, and both entries were evicted from the queue:Both fail with
error: 1 target failed: -p socket-patch-cli --test e2e_vendored_production. The production tests in that binary are all#[ignore]d, so the failure comes from the shared helper selftests compiled into it. The 1051 and 1030 groups, built on the same base in the same batch, passedcoverage, so the change being merged doesn't cause it; it's a flake.Root cause
tests/common/mod.rsgets compiled twice intoe2e_vendored_production(and into other binaries that pull invlt_e2e_common). It's included directly ascommonand again asvlt_e2e_common::common(#[path = "../common/mod.rs"] pub mod common;). As a result, eachoracle_selfteststest runs twice, at the same time, in one process. Three of those tests built their scratch paths from the PID alone:git_sha256_file_hashes_real_bytes→/tmp/socket-patch-oracle-<pid>-{a,b}.binwrite_minimal_manifest_emits_apply_compatible_shape→/tmp/socket-patch-oracle-<pid>-manifestwrite_blob_stages_exact_bytes_at_hash_path→/tmp/socket-patch-oracle-<pid>-blobscratch_diralso ranremove_dir_allfirst. When the two copies ran together, each one deleted or overwrote the other's files.Fix
Each of these tests now gets its own
tempfile::tempdir(). The directory is unique per call and removed on drop, so the hand-rolledscratch_dirhelper and the manual cleanup are gone.tempfileis already a dev-dependency. No assertions changed.Proof
Looped the
e2e_vendored_productiontest binary locally with--test-threads=16:manifest must be valid JSON: EOF,create .socket dir: NotFound,read /tmp/socket-patch-oracle-<pid>-a.bin: No such file,write_blob must stage the exact byteswithleft: [])cargo fmt --checkpasses on the file I touched.cargo clippy -p socket-patch-cli --all-targets -- -D warningsreports nothing in this file. It does report existing needless-borrow lints intests/prebuilt_common/mod.rsand two other test files, but CI'sclippyjob doesn't lint test targets.Where tests run
No tests were removed or moved. These selftests still run everywhere they ran before.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X2N3HNQzBaBgd8xyi3nxva
Generated by Claude Code
Note
Low Risk
Test-only fixture isolation change; no production or assertion logic changes.
Overview
Fixes flaky
coveragefailures in oracle selftests by replacing PID-based/tmpscratch paths withtempfile::tempdir()in three tests (git_sha256_file_hashes_real_bytes,write_minimal_manifest_emits_apply_compatible_shape,write_blob_stages_exact_bytes_at_hash_path).Because
tests/common/mod.rsis linked twice in binaries likee2e_vendored_production, those selftests could run in parallel on the same paths; the oldscratch_dirhelper (which calledremove_dir_allfirst) could clobber sibling runs. Unique per-call temp dirs and drop-based cleanup remove that race. Thescratch_dirhelper and explicit file/dir teardown are deleted; test assertions are unchanged.Reviewed by Cursor Bugbot for commit bd9c97f. Configure here.
Generated by Claude Code