Compare commits

...
Author SHA1 Message Date
Paul BakausandClaude Code b4dfde469c Tests: declare the temp-dir counter in the hook cache-root tests
The previous commit referenced TMP_SEQ there without defining it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vau2X53xGTjjTCXWMVBoNY
2026-09-04 10:35:11 -07:00
Paul BakausandClaude Code 6099995338 Tests: make the temp-dir helpers unique under a coarse clock
Windows' system clock is coarse enough that two parallel tests could get
the same pid-plus-nanoseconds directory name and then remove each
other's files (rust-windows: close_verb_round_trip_and_ownership,
NotFound). A per-process counter is appended to the name.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vau2X53xGTjjTCXWMVBoNY
2026-09-04 10:32:53 -07:00
Paul BakausandClaude Code 45ad3c49e5 release-engine: pin checkout, upload-artifact and download-artifact at v7
The v4 pins target Node 20, which the runner now deprecates and forces
onto Node 24 with a warning on every step. The rest of the workflows
already use v7.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vau2X53xGTjjTCXWMVBoNY
2026-09-04 10:27:35 -07:00
4 changed files with 27 additions and 9 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ jobs:
- { os: windows-latest, target: x86_64-pc-windows-msvc, short: windows-x64 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check the tag matches ENGINE_VERSION
shell: bash
run: |
@@ -51,7 +51,7 @@ jobs:
if: ${{ !matrix.cross }}
shell: bash
run: target/${{ matrix.target }}/release/impeccable${{ runner.os == 'Windows' && '.exe' || '' }} engine-probe
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: impeccable-${{ matrix.short }}
path: target/${{ matrix.target }}/release/impeccable${{ runner.os == 'Windows' && '.exe' || '' }}
@@ -60,7 +60,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with: { path: artifacts }
- name: Lay out release assets with checksums
run: |
+8 -2
View File
@@ -687,11 +687,17 @@ mod tests_660 {
use std::collections::HashMap;
use std::path::PathBuf;
static TMP_SEQ: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
fn tmp() -> String {
let base = std::env::temp_dir().join(format!(
"impeccable-critique-{}-{}",
"impeccable-critique-{}-{}-{}",
std::process::id(),
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos()
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(),
// A per-process counter: Windows' clock is coarse enough that two
// parallel tests can share a nanosecond stamp and then delete each
// other's directories.
TMP_SEQ.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
));
std::fs::create_dir_all(&base).unwrap();
// Like Node's `realpathSync`: no `\\?\` verbatim prefix on Windows,
+8 -2
View File
@@ -437,11 +437,17 @@ pub fn load_known_rule_ids() -> Option<Vec<String>> {
mod tests {
use super::check_hook_installation;
static TMP_SEQ: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
fn tmp() -> String {
let base = std::env::temp_dir().join(format!(
"impeccable-doctor-hook-{}-{}",
"impeccable-doctor-hook-{}-{}-{}",
std::process::id(),
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos()
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(),
// A per-process counter: Windows' clock is coarse enough that two
// parallel tests can share a nanosecond stamp and then delete each
// other's directories.
TMP_SEQ.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
));
std::fs::create_dir_all(&base).unwrap();
// Like Node's `realpathSync`: on Windows, `canonicalize` yields a
+8 -2
View File
@@ -13,6 +13,8 @@ use impeccable_hook::hook_lib::{get_cache_path, get_pending_path, Runtime};
use impeccable_hook::hook;
use serde_json::json;
static TMP_SEQ: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
static HTML: MissingHtmlEngine = MissingHtmlEngine;
static ENV_LOCK: Mutex<()> = Mutex::new(());
@@ -47,9 +49,13 @@ struct Tmp(PathBuf);
impl Tmp {
fn new() -> Tmp {
let base = std::env::temp_dir().join(format!(
"impeccable-cache-root-{}-{}",
"impeccable-cache-root-{}-{}-{}",
std::process::id(),
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos()
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(),
// A per-process counter: Windows' clock is coarse enough that two
// parallel tests can share a nanosecond stamp and then delete each
// other's directories.
TMP_SEQ.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
));
std::fs::create_dir_all(&base).unwrap();
// Like Node's `realpathSync`: no `\\?\` verbatim prefix on Windows, so the