Skip to content

test(global-db): avoid unused raw fixture connections - #4897

Merged
ScriptedAlchemy merged 3 commits into
masterfrom
fix/global-db-unused-fixture-opens-20261114
Nov 15, 2026
Merged

ScriptedAlchemy merged 3 commits into
masterfrom
fix/global-db-unused-fixture-opens-20261114

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Why

The LCM schema fixtures still construct a raw TestConnection after canonical registered initialization, then immediately discard it at 17 successful call sites. That starts an unused persistent writer and reader pool. The remaining callers only inspect initialization failures. This unnecessary work was found while investigating the global database unit-suite timeout on #4857.

Changes

  • Move all 41 remaining callers to the existing initialize_global_db helper and delete the redundant open_global_db wrapper.
  • Preserve canonical registered admission and owner release, the 24 error-only paths, and every schema, restart, cursor, catalog, marker, ledger and mutation assertion.
  • Retain raw connections wherever a fixture actually reads or changes SQL data.
  • Use direct expect_err assertions at the two temporal-cursor refusal sites. These address the observed Clippy findings while preserving the same error values and messages.

Against current master, the fixture cleanup changes six test files. Production code and execution limits are unchanged.

SDK failure-context follow-up

Master SDK conformance freshly passed 48/49 production cases. Its missing-workflow-definition check received a validated canonical HTTP 503 problem where it requires 404, but the failed assertion omitted that problem's details.

A separate test-only commit adds {problem:?} to that existing assertion message. This exposes the already decoded code and envelope on failure, with the expected 404 and every following concealment, contract and retry assertion unchanged. It adds no requests or waits and does not identify or fix the 503 cause. This adds one SDK test file to the six fixture files above.

Validation and current head

The current head 310bdd46 integrates actual master 97caca9f, the fixture correction and the SDK diagnostic. Its tree is d0dd3022494d2c0e7d8a9b3307fdaad7c741c4d7. Independent review reconstructed all 6,717 entries as the exact union of master, the six corrected fixture postimages and the one SDK assertion change. Pinned rustfmt, actual commitlint and diff checks passed.

On previous head 92b2a787, ordinary CI passed all 180 Linux targets with 20 fresh executions, including global database unit tests freshly in 123.6 seconds. Its ordinary Windows job passed 467 build/typecheck targets and 26,371 actions. The only failed gate was the two Clippy findings corrected here. All prior-head jobs were terminal, and the complete Linux, Windows and Clippy logs were preserved and independently verified before the non-force update.

Current-head ordinary CI passes Clippy. Linux job 132601737654 completed 179/180 targets, with 21 fresh executions; global database passed freshly in 96.8 seconds. The sole failed target was hooks_lsp_suite (28/29): its receipt-backlog test still saw all 65 receipts after the existing 10-second bound. The restarted daemon log records readiness at 521 ms, but does not establish whether startup discovery, project admission or a drain pass completed. The same fixture and startup/replay sources produced the same 65-receipt symptom on the earlier diagnostic run 43631589275; the source comparison does not establish identical execution conditions or a cause.

Windows job 132607685215 passed all 467 build/typecheck targets and 26,371 actions. The complete Linux and Windows logs are retained and independently hash-verified, along with the failing test artifact. Tested synthetic merge dcdabf03 has the exact current PR tree and parents actual master 97caca9f plus 310bdd46. The Linux failure still prevents qualification.

The dedicated SDK conformance workflow is required to execute its production-router case with the configured --include-ignored selection; this workflow has master-push and manual-dispatch triggers only. It has not been dispatched for this head. Ordinary PR CI excludes the installed production case and does not supply that owning execution. The 503 cause remains unresolved.

The fixture cleanup removes proven unused actor startup and teardown. It does not establish the cause or resolution of the observed 302-second timeout, and no measured speedup is claimed.


Devin Review

@changeset-bot

changeset-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1d9a28e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@ScriptedAlchemy
ScriptedAlchemy merged commit b7eaa2a into master Nov 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant