-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent infinite loop on prettyDOM calls #7250
Merged
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2605182
fix: prevent infinite loop on prettyDOM calls
tsirlucas f780722
fix lint
tsirlucas 0b13cbf
use MAX_SAFE_INTEGER instead of MAX_VALUE
tsirlucas 6be46fe
add test case to handle large nested DOM in prettyDOM calls
tsirlucas f815b0a
handle browser crash in playwright provider
tsirlucas 9b02f20
fix lint issues
tsirlucas ed16cda
bump test counter
tsirlucas 0841caf
Merge branch 'main' into main
tsirlucas 34ff688
adjust test count
tsirlucas 7c00ff2
Merge branch 'main' of https://github.com/tsirlucas/vitest
tsirlucas c0b9c08
rebump test count
tsirlucas 4e1adfc
Merge branch 'main' into main
tsirlucas e2f36ac
fix browser crash test
tsirlucas 3a343d3
Merge branch 'main' of https://github.com/tsirlucas/vitest
tsirlucas 8ee78bc
force maxDepth to be under predefined value
tsirlucas 4d1728d
bump test counter
tsirlucas 32a967f
update snapshot
tsirlucas 9c2f84d
update test counters
tsirlucas 2189730
add bigger timeout to large dom test
tsirlucas 3bcb162
increase large dom test timeout
tsirlucas 69299a2
exit gracefully on webdriver crash
tsirlucas 8f6f9a6
Merge branch 'main' into main
tsirlucas d88b2a1
fix lint
tsirlucas f10d107
Merge branch 'main' of https://github.com/tsirlucas/vitest
tsirlucas fc4f64a
better crashing strategy
tsirlucas 346c2ef
dont test crash on webkit
tsirlucas 39bc395
undo webdriver changes
tsirlucas 77b8972
remove unneeded code
tsirlucas 1a90e07
better assertion for prettyDOM test
tsirlucas 0002e1b
update maxContent for readability
tsirlucas 891036d
adjust test so test counter is not dynamic
tsirlucas ed80dc4
use different depth and maxContent values for better snapshots
tsirlucas 6307327
use test.runIf in browser crashing test
tsirlucas 90600e8
pr review fix
tsirlucas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here instead of
Number.MAX_VALUE
we could go withresult.length
. The max possible depth in the DOM will never be bigger than the length of its stringified content. But Im afraid Im missing some edge case (e.g. custom maxLength may mess things up) soNumber.MAX_VALUE
is safer approach IMO.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is stil a pretty big recursion so I wonder how it will behave in CI env with limited resources. Will run a test and get back here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I have pretty similar results time-wise doesnt matter if I use
Number.MAX_VALUE
or just10
.