Repository navigation
Prove the SQL store end to end on a migrated version 6 database - #317
Merged
Merged
Conversation
Acceptance tests against a real engine serve, with no sqlite3 on its PATH, on a copy of the version 6 fixture migrated on open: the private backup and migration, every recorded read, slimmed snapshots, reads beside a held write, writes and request keys, receipt retention, backup and the refusals; a dashboard refresh through a recording proxy; each coordinator View of two plans in two repositories; and the docs' sqlite3 mentions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVCLzRGGgXRmsf9hjTb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVCLzRGGgXRmsf9hjTb
The default client could leave a connection open that held engine serve's shutdown past its deadline. Subtests fail their own test, the test's database connections wait for the server's writer, and a refusal that regressed fails within 30 seconds instead of hanging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVCLzRGGgXRmsf9hjTb
…tance tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVCLzRGGgXRmsf9hjTb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVCLzRGGgXRmsf9hjTb
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.
Objective
End-to-end acceptance tests for the SQL store, run on a copy of the version 6 fixture database (
internal/control/testdata/records-v6.sql) that is migrated as it opens. The main suite runs a realengine servewith an emptyPATH, so nosqlite3. The relational schema is version 7, because version 6 was already taken. So opening the fixture writes<db>.pre-v7, and a version 8 database is refused. The tests changed no production code and no docs; they showed no doc to be untrue.Gates
./dev test(every required lane)internal/control/bench_test.go)TestStoreAnswersWithinItsPerformanceTargetsandTestOpeningWithTenTimesTheHistoryStaysWithinTheBoundpass at their 10× bound. Run locally with the bound set to 1× (reverted, not committed), both passed 3 of 3 runs.BenchmarkStore(200 runs, mean per op, Ryzen 9 5900HX): get 0.07 ms, updates 0.13 ms, session-view 0.56 ms (1 ms targets); inbox 0.74 ms, overview 2.28 ms, plan-detail 1.06 ms, say 0.28 ms, one-record write 0.10 ms (5 ms targets).internal/cli/store_acceptance_test.go: a realengine servewith nosqlite3onPATH, on the version 6 fixture..pre-v7copy, migrates to version 7 and drops the records table. All 40 recorded reads answer as the version 6 server did.stateandversion, both in the API answer and in the stored row.serve --backupwrites an owner-only version 7 copy, and the database reopens.internal/cli/store_dashboard_acceptance_test.go: O5. A realengine uiagainst that server, through a proxy that records each call and holds it until three are in flight. The refresh routes, requested together, make exactly three calls (overview,plan-detail,updateswithafterset to the cursor), all in flight at once. The thread holds only updates after the cursor.internal/controlrun/fixture_scope_test.go: O4. On the migrated fixture, with a second coordinating plan in a second repository, each plan's View:A full pass over both plans walks no table.
internal/cli/store_docs_acceptance_test.go: O7. Every paragraph, list item and table row in the persistent docs that namessqlite3names it for a Codex host, the tests' tool lists or the offline status check.internal/cli/stack_test.go,internal/controlrun/coordinator_test.go:startDashboardOnandcoordinatorOnsplit out of the existing helpers.Mutation checks, each applied, run and reverted: serialising the dashboard's upstream calls, reading the thread from 0, a View that reads other plans' items, and a doc row saying the server needs
sqlite3. Each makes its test fail. The reviewers also mutated backup mode, snapshot slimming, retention, the reader pool and overview sharing.TestDashboardInBrowserskips locally as before; CI installs one.Rulings
None. O7:
docs/operator-setup.mdstill says the offlineengine server statusdatabase check is unknown withoutsqlite3on the server. That stays, following the earlier review ruling on the driver change (#305). It is a diagnostic, not a server prerequisite, and the docs test allows it by name.Review
-race -cpu 1.http.DefaultClientleft an idle connection that heldengine serve's shutdown past its 5 s deadline. Fixed: the test uses a client of its own, which it closes before SIGTERM, and the dashboard proxy uses it too. Now 30 of 30 pass.t, not the parent's; a 30 s deadline on each refusal run; a comment worded as history.LookPathcheck that could never fail.sqlite3in a numbered list beside Codex, and the check's failure is shown by mutation;stopafter a SIGTERM timeout can raceWait: only on a path that has already failed;go testtimeout;itoaviajson.Marshal: cosmetic.internal/cli/store_dashboard_acceptance_test.go: thecommandLogbarrier is what makes "in parallel" a real check.Deviations
internal/controlrun, on the migrated fixture, not through theengine servesubprocess. A subprocess's queries can't be traced. The pass builds each View with the sameCoordinator.viewthe test traces.Implemented by Claude Code (claude-opus-5-5).
🤖 Generated with Claude Code
https://claude.ai/code/session_012F3VVCLzRGGgXRmsf9hjTb