Self-heal the dev DB around heavy test suites#51
Merged
Conversation
Large scale-sweep / VLM runs seed real graphs; an interrupted run (timeout,
Ctrl-C) skips its per-test cleanup and leaves orphan WorkItems + drifted seed
positions behind. That pollution made THE GATE's grow-flow flake (force-click
landing on an overlapping node) until a manual re-seed.
Now the heavy suites self-heal:
- All test-seeded graphs are tagged with a sentinel name prefix ("[E2E]")
so they're unmistakably identifiable (never matches a real/seed graph).
- tests/helpers/dbHealing.ts sweepTestData() (Cypher over bolt, batched,
fully graceful if Neo4j is down) removes: sentinel/legacy test-named graphs
+ their WorkItems/Edge nodes, orphan WorkItems (no BELONGS_TO), and orphan
Edge nodes (missing source/target — the data-integrity incident class).
It never touches seed/demo graphs.
- scale-sweep.spec.ts and visual-vlm.spec.ts call it in beforeAll (heal
leftovers from a prior killed run) and afterAll (clean up this run even if a
per-run delete was skipped).
Verified: injected a test graph + orphan node + orphan edge → sweep removed
exactly those, seed data (44 items) untouched; a scale run leaves 0 test
graphs / 0 orphans; THE GATE stays 5/5 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧪 Comprehensive Test Suite
Full-stack smoke gate runs in the CI workflow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Large
scale-sweep/visual-vlmruns seed real graphs through the API. When a run is killed mid-flight (timeout, Ctrl-C), its per-test cleanup never executes and the dev DB is left with orphan WorkItems and drifted seed-graph positions. That pollution made THE GATE's grow-flow test flake (a force-click landing on an overlapping node) until a manualnpm run db:seed. "We need clean systems."What
The heavy suites now self-heal:
[E2E](TEST_GRAPH_PREFIX), so it's unmistakably identifiable and can never match a real/seed graph.tests/helpers/dbHealing.ts→sweepTestData()— Cypher over bolt, batched, fully graceful (logs and returns if Neo4j is unreachable; never fails the run). Removes:BELONGS_TO) — what a half-finished delete leaves,It never touches seed/demo graphs (Welcome, Cycle 2, Aquarium, …).
beforeAll(heal leftovers from a prior killed run) andafterAll(clean up this run) — so the DB self-heals even after an interruption.Verified
[E2E]graph + orphan node + orphan edge → sweep removed exactly those; seed data (44 items) untouched.No CI impact (these projects aren't invoked in CI; healing is graceful and only runs for the heavy local suites).
🤖 Generated with Claude Code