test: move sqlite length validation out of the reentry test - #65769
Open
TrevorBurnham wants to merge 1 commit into
Open
test: move sqlite length validation out of the reentry test#65769TrevorBurnham wants to merge 1 commit into
TrevorBurnham wants to merge 1 commit into
Conversation
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>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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 🚀 New features to boost your workflow:
|
trivikr
approved these changes
Sep 4, 2026
Collaborator
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.
Follow-up to #65595, addressing @araujogui's review comment there.
The
non-integer callback lengthsuite intest-sqlite-options-getter-reentry.jschecks thatfunction()andaggregate()reject a callback whoselengthproperty 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:
function()check into theinput validationsuite intest-sqlite-custom-functions.js, beside the other argument type checks.options.step.lengthandoptions.inverse.lengthchecks into theinput validationsuite intest-sqlite-aggregate-function.mjs.a normal function length is still accepted, which duplicatesuses function.length when falseintest-sqlite-custom-functions.js.Two
lengthtests stay in the reentry file:function() throws when the length getter closes the databaseand itsaggregate()equivalent. Those put the getter onlengthitself and close the database from it, which is exactly the reentrancy that file covers, and why the state re-check has to sit after thelengthread rather than before it.