Skip to content

test: move sqlite length validation out of the reentry test - #65769

Open
TrevorBurnham wants to merge 1 commit into
nodejs:mainfrom
TrevorBurnham:sqlite-move-length-validation-tests
Open

test: move sqlite length validation out of the reentry test#65769
TrevorBurnham wants to merge 1 commit into
nodejs:mainfrom
TrevorBurnham:sqlite-move-length-validation-tests

Conversation

@TrevorBurnham

@TrevorBurnham TrevorBurnham commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #65595, addressing @araujogui's review comment there.

The non-integer callback length suite in test-sqlite-options-getter-reentry.js checks that function() and aggregate() reject a callback whose length property is not an integer. It doesn't belong in a file about option getters re-entering the database.

This PR makes these changes to the tests:

  • Move the function() check into the input validation suite in test-sqlite-custom-functions.js, beside the other argument type checks.
  • Move the options.step.length and options.inverse.length checks into the input validation suite in test-sqlite-aggregate-function.mjs.
  • Drop a normal function length is still accepted, which duplicates uses function.length when false in test-sqlite-custom-functions.js.

Two length tests stay in the reentry file: function() throws when the length getter closes the database and its aggregate() equivalent. Those put the getter on length itself and close the database from it, which is exactly the reentrancy that file covers, and why the state re-check has to sit after the length read rather than before it.

The "non-integer callback length" suite in
test-sqlite-options-getter-reentry.js checks that function() and
aggregate() reject a callback whose length property is not an integer.
That is plain argument validation: no property getter runs, and nothing
changes mid-call, so the tests do not belong in a file about option
getters re-entering the database.

Move them into the "input validation" suites that already cover the
other argument type checks for each method. Drop "a normal function
length is still accepted", which duplicates "uses function.length when
false" in test-sqlite-custom-functions.js.

The two tests that put the getter on length itself stay where they are,
since closing the database from that getter is what they exercise.

Refs: nodejs#65595
Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Sep 4, 2026
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (abc66cb) to head (9ec6e53).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65769   +/-   ##
=======================================
  Coverage   90.05%   90.05%           
=======================================
  Files         769      769           
  Lines      261316   261316           
  Branches    49621    49630    +9     
=======================================
+ Hits       235319   235322    +3     
+ Misses      17041    17037    -4     
- Partials     8956     8957    +1     

see 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trivikr trivikr added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Sep 4, 2026
@trivikr
trivikr requested a review from geeksilva97 September 4, 2026 04:23
@trivikr trivikr added the sqlite Issues and PRs related to the SQLite subsystem. label Sep 4, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@araujogui araujogui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@trivikr trivikr added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants