Repository navigation
improve: make state-heavy test suites faster - #119617
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 10:24 AM ET / 14:24 UTC. ClawSweeper reviewWhat this changesThis PR creates validated SQLite test fixtures once and clones them for isolated state tests, while using native Buffer byte equality for a large database snapshot assertion. Merge readinessKeep open for the normal human merge decision: the exact reviewed head has no actionable correctness or security finding, and current main has not absorbed this test-only optimization. Priority: P3 Review scores
Verification
How this fits togetherState and agent database tests normally open SQLite through production lifecycle code before exercising migrations, integrity checks, and data constraints. This change keeps production-opening coverage where it matters while reusing closed, validated current-schema fixtures for independent mutation cases. flowchart LR
A[Production database opener] --> B[Validated current-schema fixture]
B --> C[Isolated test database copy]
C --> D[Schema and migration test]
D --> E[Production reopen assertions]
F[Database snapshot bytes] --> G[Native byte equality check]
G --> E
Before merge
Agent review detailsSecurityNone. PR surfaceTests -54. Total -54 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the focused test-only optimization after the designated maintainer performs the final normal PR review; retain production-open coverage for fresh creation, recovery, and lifecycle tests. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR improves test execution rather than fixing a user-facing failure; its changed behavior is directly covered by the recorded focused suite run. Is this the best way to solve the issue? Yes. Reusing the existing validated-fixture pattern avoids repeated expensive opens while retaining fresh-open, integrity, migration, WAL, and recovery tests on the production path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1b4a60be15a1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: (130 commits) refactor(qa): consolidate scenario runtime helpers (openclaw#119623) fix(telegram): bind Mini App auth to dashboard launches refactor(agent-core): unify session projection and compaction summaries (openclaw#119639) fix(codex): allow natural reactions in the current conversation (openclaw#119649) refactor(providers): deduplicate bundled model catalogs (openclaw#119627) fix(ui): observe the active service worker after asset refresh (openclaw#119622) fix(agents): strip echoed base64 image payloads so photo-heavy turns no longer hit the per-turn output cap (openclaw#119488) improve: make state-heavy test suites faster (openclaw#119617) perf(agents): add concurrency benchmark (openclaw#119569) fix(browser): visibly report failed pairing and tab-sharing actions (openclaw#119526) refactor(lobster): consolidate embedded workflow execution (openclaw#119630) fix(plugin-sdk): stabilize tuple-derived API baseline ordering (openclaw#119635) docs(skills): make full-authority maintainer runs unattended (openclaw#119629) fix(managed-child): honor process groups that vanish before cleanup (openclaw#119614) fix(ci): stop label-driven automation churn (openclaw#119610) fix(media): keep the ttl sweep out of the managed outgoing tree (openclaw#119127) fix(claws): remove owner-qualified skills (openclaw#119606) fix(clawrouter): show stable error for malformed usage responses (openclaw#119580) fix(gateway): claim malformed plugin icon routes (openclaw#119559) fix(telegram): preserve truthful empty-content delivery (openclaw#88810) ...
* test(state): reuse current database fixtures * test(claws): compare database snapshots directly * test(state): remove obsolete fixture options --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The slow Node test tail repeatedly pays full SQLite integrity and canonical-schema validation merely to manufacture current database bytes that tests immediately close and mutate. One Claw dry-run assertion also asks Vitest to recursively compare a 1.5 MiB Buffer byte by byte.
Why This Change Was Made
Current state and agent database fixtures are created once through the production opener, verified, closed, and cloned into isolated per-test directories. Tests that own fresh creation, WAL and rollback recovery, process concurrency, path/cache behavior, pragmas, registration, and leases still use real production opens. Claw snapshot equality now uses Node's native byte-for-byte Buffer comparison.
No test declarations, shard topology, worker counts, concurrency settings, scheduling, or timeouts change.
User Impact
There is no product behavior change. Contributors and maintainers get faster test feedback while retaining the same state migration, integrity, constraint, and non-mutation coverage.
Evidence
cbx_afa7d336374c, runrun_2554c9a8c05a:pnpm test src/state/openclaw-state-db.test.ts src/state/openclaw-agent-db.test.ts src/claws/update-plan.test.tsBuffer.equalssemantics instead of recursive matcher traversal.git diff --checkpassed.gpt-5.6-sol, high reasoning).This is an incremental step toward the frozen raw full-suite target; it does not claim normalized or final 30% success.