Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion bootstrap/tests/corpus_zig_bodies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,25 @@ fn per_spec_carries_three_zig_digits_and_says_so_in_its_header() {
eprintln!("zig not on PATH -- SKIPPED");
return;
}
let dir = std::env::temp_dir().join(format!("t27-corpuscols-{}", std::process::id()));
// Keyed by a COUNTER, not by the pid alone. Every test in this binary
// shares the pid, and the `remove_dir_all` below deletes the whole
// directory -- so two tests that both used it would race, one erasing the
// file the other is mid-read of.
//
// Only one test here touches the directory today, so the race cannot fire.
// The gate that caught this refuses the SHAPE rather than the outcome, and
// it is right to: a second test using the same helper is one edit away, and
// that edit would not look like the change that broke anything.
//
// `tri harness scratch` went red on master within a day of being wired, on
// a file written by the person who wired it.
static SCRATCH_N: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
let scratch_n = SCRATCH_N.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
let dir = std::env::temp_dir().join(format!(
"t27-corpuscols-{}-{}",
std::process::id(),
scratch_n
));
std::fs::create_dir_all(&dir).expect("temp dir");
let path = dir.join("per-spec.txt");
let out = Command::new(env!("CARGO_BIN_EXE_t27c"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NOW -- The gate went red on the person who wired it (2026-08-31)

## The gate went red on the person who wired it (Closes #2972)

- Harness scratch directories failed on master at corpus_zig_bodies.rs -- three tests, a pid-only scratch key, and a remove_dir_all of it
- added by #2966, the same pass that wired the gate; the race cannot fire today because only one of the three tests uses the directory
- the gate refuses the SHAPE not the outcome, which is why it fired on the commit that introduced it rather than on a later innocent one
Loading