test(drizzle): stress SQL prefixes across garbage collection - #9948
test(drizzle): stress SQL prefixes across garbage collection#9948jdalton wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThis change adds a database-free Drizzle SQL-prefix stress probe. The probe validates narrow and wide SQL queries, parameters, retained results, and explicit GC activity. Release-fixture wiring, expected output, documentation, and a changelog entry are included. ChangesDrizzle SQL-prefix stress probe
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This adds a database-free Drizzle SQL-prefix stress fixture and release-test coverage without changing production behavior. The fixture exercises narrow and wide query generation across garbage collection and is ready to merge. Sequence Diagram(s)sequenceDiagram
participant Fixture as fixture.sh
participant Probe as entry.ts
participant Builder as QueryBuilder
participant GC as Explicit GC
participant Checks as SQL and parameter checks
Fixture->>Probe: Run compiled probe
Probe->>Builder: Build narrow and wide queries
Probe->>GC: Collect every 16th iteration
Probe->>Checks: Validate SQL and parameters
Checks-->>Probe: Return validation results
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on |
Issue #9935 reports a Drizzle SELECT arriving at MySQL with its SQL and parameter prefixes missing while the later ORDER BY/LIMIT survives. Add a database-free stress fixture at the query-construction boundary using the exact reported drizzle-orm 0.44.7 version.
The fixture checks the full SQL and each parameter for the original four-predicate query and a wider variant that repeatedly grows chunk/parameter arrays. It varies values per iteration, retains previous results, and collects before appending the tail and after materializing SQL. The release fixture harness discovers it automatically; the README documents longer and scheduled-GC runs.
Refs #9935. This is an investigation PR, not a confirmed reproduction or fix. Keep the issue open: the original failure is rare and Linux-specific, and this probe does not exercise mysql2, transactions, or async scheduling.
Validation on macOS arm64: compiler and static runtimes rebuilt together at PR head
f8a33e212145acfd970624a031cebe51ea2bbc80with pinned nightly-2026-08-20 in perry-dev; probe compiled with--no-auto-optimize. Normal, forced, and small scheduled runs repeated successfully at this final head:Node 26.5.1: 1,000 iterations, 3,999 exact query/result checks, 126 explicit GC calls; expected output matches.
Perry normal collection: same output, exit 0.
Perry forced evacuation with verification: same output, exit 0; 126
[gc-copy-minor] ranrecords.Negative controls that remove the SQL prefix or parameter prefix are both rejected by the assertions.
Test-registration audit, Node-version consistency, shell syntax, and whitespace checks pass.
Dense scheduled GC (seed 9935, rate 0.05, allocation pacing disabled, protected fromspace): 10 iterations pass with 3,590 copying minors and 3,590 protected-fromspace records. The README uses this bounded example.
The 1,000-iteration dense scheduled attempt timed out after 60 seconds and 20,719 copying minors. It is incomplete, not a pass.
All 64 runnable script/format lint gates pass; two CI-only expressions and the workspace-wide compiler check/clippy tier were skipped. The compiler and static runtimes were built for executing this probe.
The original production failure remains unconfirmed locally.
Summary by CodeRabbit
Tests
Documentation