From 5b1fce0ba1cfb43684807814a35bca76620d17d4 Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Thu, 3 Dec 2026 12:03:46 +0530 Subject: [PATCH] Clarify integration test comments --- tests/common/mod.rs | 7 +++---- tests/cursor_test.rs | 6 +++--- tests/disjunction_test.rs | 2 +- tests/docker_lock_test.rs | 13 ++++++------- tests/nfs_lock_test.rs | 7 +++---- tests/nightly_candidates_acceptance_test.rs | 13 ++++++------- tests/recursive_acceptance_test.rs | 8 ++++---- 7 files changed, 26 insertions(+), 30 deletions(-) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index ec25b67ff3..39d07aed96 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -19,10 +19,9 @@ use minigraf::db::{Minigraf, OpenOptions}; /// was ever really involved. Capping this binary to one fork in flight at a /// time keeps that window rare enough not to flake the suite. /// -/// This is now belt-and-braces: `FileBackend::open_with` (src/storage/backend/file.rs) -/// retries a cross-process `WouldBlock` with bounded backoff, which is the -/// real fix for the false-negative window described above. This mutex is -/// cheap insurance on top of that, not load-bearing on its own. +/// `FileBackend::open_with` already retries a cross-process `WouldBlock` +/// with bounded backoff. This mutex also prevents two tests in this binary +/// from forking at the same time. static CRASH_CHILD_SPAWN_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(()); /// Whether the crashing child commits `statements` as one explicit diff --git a/tests/cursor_test.rs b/tests/cursor_test.rs index 919e3a80a0..28068414b7 100644 --- a/tests/cursor_test.rs +++ b/tests/cursor_test.rs @@ -1,8 +1,8 @@ #![cfg(test)] //! `Minigraf::query` and `PreparedQuery::query` return a `Cursor` that delivers -//! the answer in batches (#432). These tests pin the public contract the -//! streaming engine must keep: batches partition the `execute()` answer, the -//! answer is fixed when the cursor opens, and non-queries are rejected. +//! the answer in batches (#432). The tests check that reading every batch gives +//! the same rows as `execute()`, that the answer is fixed when the cursor opens, +//! and that cursors reject non-query statements. // File-backed (Minigraf::open, tempfile): native only, like the other file tests. #![cfg(not(target_arch = "wasm32"))] diff --git a/tests/disjunction_test.rs b/tests/disjunction_test.rs index 09e1c1c743..3641e375f6 100644 --- a/tests/disjunction_test.rs +++ b/tests/disjunction_test.rs @@ -316,7 +316,7 @@ fn test_or_with_as_of() { #[test] fn test_or_with_not_cycle_rejected() { let db = db(); - // Bind ?x first so both or-branches have the same new-variable footprint (none). + // Bind ?x first so neither or branch introduces a new variable. db.execute(r#"(rule [(p ?x) [?x :a true] (or (and (not (q ?x))) [?x :a true])])"#) .unwrap(); let result = db.execute(r#"(rule [(q ?x) [?x :b true] (or (and (not (p ?x))) [?x :b true])])"#); diff --git a/tests/docker_lock_test.rs b/tests/docker_lock_test.rs index 3ef447fd69..cf0f213f39 100644 --- a/tests/docker_lock_test.rs +++ b/tests/docker_lock_test.rs @@ -1,12 +1,11 @@ #![cfg(test)] -//! #324: kernel file locking, tier 3 — two containers sharing a Docker -//! volume, matching the deployment shape in the #317 report literally. +//! #324: test kernel file locking (tier 3) with two containers sharing a +//! Docker volume, as in #317. //! -//! Mechanically the same path as `tests/pid_namespace_test.rs` (tier 1): a -//! holder dies without running `Drop`, and a replacement sharing the same -//! storage must still be able to open the database. Docker gives it a real -//! `SIGKILL` and a genuinely separate PID namespace per container, rather -//! than `unshare` simulating one. +//! As in `tests/pid_namespace_test.rs` (tier 1), kill the lock holder without +//! running `Drop`, then check that a replacement can open the same database. +//! Docker sends `SIGKILL` and puts each container in its own PID namespace; +//! the tier 1 test uses `unshare`. //! //! Needs a working Docker daemon, which this sandbox does not have and which //! `.github/workflows/nfs-lock.yml` provisions on its runner. Skips cleanly diff --git a/tests/nfs_lock_test.rs b/tests/nfs_lock_test.rs index 64ac132544..e313e77cab 100644 --- a/tests/nfs_lock_test.rs +++ b/tests/nfs_lock_test.rs @@ -32,10 +32,9 @@ fn run_helper(helper: &Path, db: &Path, mode: &str) -> Output { .expect("run helper") } -/// The helper must reject an unrecognized mode string rather than silently -/// falling through to a plain open. Without this, a typo'd or unimplemented -/// mode (like `open-unlocked` before it exists) is indistinguishable from -/// `open` — exactly the false-green trap this guards against. +/// The helper must reject an unknown mode. If a misspelled or unimplemented +/// mode behaved like `open`, the test could pass without exercising the +/// intended case. #[test] fn test_unrecognized_mode_fails_loudly_instead_of_falling_through() { let helper = helper_binary(); diff --git a/tests/nightly_candidates_acceptance_test.rs b/tests/nightly_candidates_acceptance_test.rs index 0d1e70ef93..af5ce15683 100644 --- a/tests/nightly_candidates_acceptance_test.rs +++ b/tests/nightly_candidates_acceptance_test.rs @@ -1,11 +1,10 @@ #![cfg(test)] -//! Nightly acceptance for the #841 shape-sweep candidates qualified by #863: -//! each test pins one candidate's answer and the path it guards (operator -//! names from the cursor's `Debug` view, `minigraf::__path_events`) and, -//! where the behavior is memory, its charged query memory -//! (`Cursor::__memory_peak`). Time is measured separately, by the Criterion -//! cases in `benches/minigraf_bench/nightly_candidates.rs`; a path regression -//! fails here, a slower runner cannot. +//! Nightly tests for the #841 candidates qualified by #863. Each test checks +//! the result and execution strategy using operator names from the cursor's +//! `Debug` view and `minigraf::__path_events`. Tests that check memory use +//! `Cursor::__memory_peak` to measure memory charged to the query. Criterion +//! measures time separately in `benches/minigraf_bench/nightly_candidates.rs`; +//! these tests do not check timings. //! //! Ignored by default; `.github/workflows/smoke.yml` runs them nightly: //! diff --git a/tests/recursive_acceptance_test.rs b/tests/recursive_acceptance_test.rs index f39230e5ea..fee923467c 100644 --- a/tests/recursive_acceptance_test.rs +++ b/tests/recursive_acceptance_test.rs @@ -113,10 +113,10 @@ fn reach_5m() { assert_eq!(err.code().to_string(), "INT-020", "stopped by the limit"); } -/// Both sizes must meet a retained-relation bound and a coarse time-scaling -/// guard. Doubling a chain quadruples its closure; nonlinear self-joins can -/// do cubic work. The 16x + 1s guard tolerates CI noise without accepting an -/// unbounded blow-up. Absolute per-query budget: 60 seconds. +/// Both sizes must meet the retained-relation bound and finish each query in +/// less than 60 seconds. Doubling the chain roughly quadruples its closure, +/// and nonlinear self-joins can do cubic work. The larger query can take up +/// to 16 times the smaller query's time plus one second for CI timing variation. fn closure_scaling(multistratum: bool) { let mut small_time = None; for nodes in [256usize, 512] {