FFFF Clarify v2.x integration test comments by adityamukho · Pull Request #996 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

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
7 changes: 3 additions & 4 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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` retries a `WouldBlock` with bounded backoff
/// unless this process already has the file open. This mutex also keeps
/// 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
Expand Down
2 changes: 1 addition & 1 deletion tests/disjunction_test.rs
8000
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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])])"#);
Expand Down
13 changes: 6 additions & 7 deletions tests/docker_lock_test.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//! #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
Expand Down
7 changes: 3 additions & 4 deletions tests/nfs_lock_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,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();
Expand Down
Loading
0