Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

test(hub): sync e2e counts pin directories, not the flock files beside them

xerj-org587543e7386c
diff --git a/engine/crates/xerj-hub/tests/sync_e2e.rs b/engine/crates/xerj-hub/tests/sync_e2e.rs
index bf770c681..3d3f2eabc 100644
--- a/engine/crates/xerj-hub/tests/sync_e2e.rs
+++ b/engine/crates/xerj-hub/tests/sync_e2e.rs
@@ -430,10 +430,17 @@ fn age_file(path: &Path, secs: u64) {
.unwrap();
}
+/// Every DIRECTORY under the corpus's pack dir: installed pins, plus any
+/// half-extracted `<pin8>.tmp` scratch dir a broken pull or sync would leave
+/// (which must show up and fail the assertion). The `<pin8>.lock` files are
+/// left out on purpose: they are flock files that `crate::flock` never deletes
+/// by design (unlinking one lets a waiter lock a dead inode), so they are not
+/// state a pull or a sync is responsible for removing.
fn pin_dirs(hub_home: &Path) -> Vec<String> {
let mut v: Vec<String> = std::fs::read_dir(hub_home.join("packs/mini-c"))
.map(|rd| {
rd.flatten()
+ .filter(|e| e.file_type().is_ok_and(|t| t.is_dir()))
.map(|e| e.file_name().to_string_lossy().into_owned())
.collect()
})