From b73cf1a92e9196708aa61145a0d87f155a5a4c3f Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Wed, 1 Jul 2026 10:47:51 +0200 Subject: [PATCH] test(engine): seed recovery_rolls_forward_load_overwrite edge-free MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test seeded the full fixture (test.jsonl, which carries Knows/WorksAt edges) then fault-injected a per-table Overwrite of node:Person down to a single row. Overwrite RI validation now correctly rejects that: dropping the seeded Persons strands the retained edges, so the load failed with "src 'Alice' not found in Person" during validation — before it reached the post-finalize failpoint the test drives, so the recovery roll-forward was never exercised. Seed Persons only (no edges) so the overwrite is a clean single-table roll-forward, which is what the test asserts (RolledForward{node:Person}). The overwrite still removes the seeded Persons, so F1's overwrite-removed-ids path is still exercised — just without an orphan. Feature-gated: this binary runs under `--features failpoints`, a separate CI step from the workspace test run, so it's invisible to `cargo test -p omnigraph-engine` and only the post-merge main CI exercises it. --- crates/omnigraph/tests/failpoints.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/omnigraph/tests/failpoints.rs b/crates/omnigraph/tests/failpoints.rs index f5f4b8f2..b3e874f3 100644 --- a/crates/omnigraph/tests/failpoints.rs +++ b/crates/omnigraph/tests/failpoints.rs @@ -1016,9 +1016,20 @@ async fn recovery_rolls_forward_load_overwrite() { { let mut db = Omnigraph::init(&uri, helpers::TEST_SCHEMA).await.unwrap(); - load_jsonl(&mut db, helpers::TEST_DATA, LoadMode::Overwrite) - .await - .unwrap(); + // Seed Persons only (no edges): the fault-injected step below overwrites + // node:Person down to a single row, and a per-table overwrite that drops + // Persons referenced by seeded Knows/WorksAt edges is now rejected as an + // orphan during validation — before it ever reaches the post-finalize + // failpoint this test drives. Keeping the seed edge-free makes the + // overwrite a clean single-table roll-forward, which is what's under test. + load_jsonl( + &mut db, + "{\"type\":\"Person\",\"data\":{\"name\":\"Alice\",\"age\":30}}\n\ + {\"type\":\"Person\",\"data\":{\"name\":\"Bob\",\"age\":31}}\n", + LoadMode::Overwrite, + ) + .await + .unwrap(); parent_commit_id = branch_head_commit_id(dir.path(), "main").await.unwrap(); let _failpoint = ScopedFailPoint::new(names::MUTATION_POST_FINALIZE_PRE_PUBLISHER, "return");