Skip to content

test_runner: don't exceed call stack when filtering - #52488

Closed
cjihrig wants to merge 2 commits into
nodejs:mainfrom
cjihrig:callstack
Closed

test_runner: don't exceed call stack when filtering#52488
cjihrig wants to merge 2 commits into
nodejs:mainfrom
cjihrig:callstack

Conversation

@cjihrig

Copy link
Copy Markdown
Contributor
test_runner: move end of work check to finalize()

This commit moves the end of work check from postRun() to
finalize(). The reasoning is that finalize() is guaranteed to
run in the order that the tests are defined, while postRun() is
not. This makes the check a little simpler.

test_runner: don't exceed call stack when filtering

This commit updates filteredRun() to call postRun() after a
microtask instead of synchronously. Currently, if approximately
1,545 subtests are filtered, enough synchronous calls can be
made to cause a call stack exceeded exception.

I'm not sure if it is a good use of CI cycles to run a few thousand no-op tests to try to exceed the maximum call stack size. If people want to do that, I can update test/parallel/test-runner-filter-warning.js to do that.

This commit moves the end of work check from postRun() to
finalize(). The reasoning is that finalize() is guaranteed to
run in the order that the tests are defined, while postRun() is
not. This makes the check a little simpler.
This commit updates filteredRun() to call postRun() after a
microtask instead of synchronously. Currently, if approximately
1,545 subtests are filtered, enough synchronous calls can be
made to cause a call stack exceeded exception.
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Apr 12, 2024
@atlowChemiatlowChemi added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@atlowChemiatlowChemi added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 12, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@atlowChemiatlowChemi added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label Apr 12, 2024
@cjihrigcjihrig removed the needs-ci PRs that need a full CI run. label Apr 12, 2024

@benjamingrbenjamingr 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.

Is this semver major?

@benjamingr

Copy link
Copy Markdown
Member

(not sure what the semverness of timing changes is)

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

No, this change itself is not semver major, but it does build on a previous semver major - #52221.

@cjihrigcjihrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 13, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 14, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in e0ed09d...11f8765

nodejs-github-bot pushed a commit that referenced this pull request Apr 14, 2024
This commit moves the end of work check from postRun() to
finalize(). The reasoning is that finalize() is guaranteed to
run in the order that the tests are defined, while postRun() is
not. This makes the check a little simpler.
PR-URL: #52488
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
nodejs-github-bot pushed a commit that referenced this pull request Apr 14, 2024
This commit updates filteredRun() to call postRun() after a
microtask instead of synchronously. Currently, if approximately
1,545 subtests are filtered, enough synchronous calls can be
made to cause a call stack exceeded exception.
PR-URL: #52488
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@cjihrig
cjihrig deleted the callstack branch April 14, 2024 01:55
aduh95 pushed a commit that referenced this pull request Apr 29, 2024
This commit moves the end of work check from postRun() to
finalize(). The reasoning is that finalize() is guaranteed to
run in the order that the tests are defined, while postRun() is
not. This makes the check a little simpler.
PR-URL: #52488
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
aduh95 pushed a commit that referenced this pull request Apr 29, 2024
This commit updates filteredRun() to call postRun() after a
microtask instead of synchronously. Currently, if approximately
1,545 subtests are filtered, enough synchronous calls can be
made to cause a call stack exceeded exception.
PR-URL: #52488
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-rebaseAdd this label to allow the Commit Queue to land a PR in several commits.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@cjihrig@nodejs-github-bot@benjamingr@anonrig@MoLow@marco-ippolito@atlowChemi@richardlau