-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test_runner: run global after() hook earlier #49059
Conversation
Review requested:
|
can you please also add this test? https://github.com/MoLow/node/blob/test-runner-only/test/fixtures/test-runner/output/async-test-scheduling.mjs |
})); | ||
|
||
after(common.mustCall(() => { | ||
server.close(); |
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.
@cjihrig would it be worth ensuring the after hook also waits for cb?
server.close(); | |
server.close(common.mustCall()); |
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.
That's not a bad idea. Honestly though, the CI was a pain to get passing yesterday and I would prefer not to start over for that change.
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.
lgtm
Commit Queue failed- Loading data for nodejs/node/pull/49059 ✔ Done loading data for nodejs/node/pull/49059 ----------------------------------- PR info ------------------------------------ Title test_runner: run global after() hook earlier (#49059) Author Colin Ihrig (@cjihrig) Branch cjihrig:after-handles -> nodejs:main Labels commit-queue-squash, test_runner Commits 3 - test_runner: run global after() hook earlier - test and feedback - other test Committers 1 - cjihrig PR-URL: https://github.com/nodejs/node/pull/49059 Fixes: https://github.com/nodejs/node/issues/49056 Reviewed-By: Chemi Atlow Reviewed-By: Moshe Atlow Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/49059 Fixes: https://github.com/nodejs/node/issues/49056 Reviewed-By: Chemi Atlow Reviewed-By: Moshe Atlow Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 07 Aug 2023 22:03:17 GMT ✔ Approvals: 4 ✔ - Chemi Atlow (@atlowChemi): https://github.com/nodejs/node/pull/49059#pullrequestreview-1573038132 ✔ - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/49059#pullrequestreview-1573061500 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/49059#pullrequestreview-1573130592 ✔ - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/49059#pullrequestreview-1573170558 ✘ Last GitHub CI failed ℹ Last Full PR CI on 2023-08-11T03:28:19Z: https://ci.nodejs.org/job/node-test-pull-request/53165/ - Querying data for job/node-test-pull-request/53165/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/5832906334 |
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: nodejs#49059 Fixes: nodejs#49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Landed in 6346bdc. |
Not sure why but I am now constantly failing See stack trace
I am on Apple M2 Max with macOS 13.4 though not sure how relevant that is. |
FWIW, here is the fix before the revert: diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js
index f8c9087f6c..975ad4ac08 100644
--- a/lib/internal/test_runner/test.js
+++ b/lib/internal/test_runner/test.js
@@ -662,7 +662,7 @@ class Test extends AsyncResource {
}
}
- if (this.parent !== null) {
+ if (this.parent !== null || typeof this.hookType === 'string') {
// Clean up the test. Then, try to report the results and execute any
// tests that were pending due to available concurrency.
// |
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (nodejs#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs#49059 Refs: nodejs#49110
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: nodejs#49059 Fixes: nodejs#49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (#49059 (comment)) and an additional common.mustCall() in the added test. Refs: #49059 Refs: #49110 PR-URL: #49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: nodejs#49059 Fixes: nodejs#49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: nodejs#49059 Fixes: nodejs#49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (nodejs#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs#49059 Refs: nodejs#49110 PR-URL: nodejs#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: #49059 Fixes: #49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (#49059 (comment)) and an additional common.mustCall() in the added test. Refs: #49059 Refs: #49110 PR-URL: #49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: nodejs#49059 Fixes: nodejs#49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (nodejs#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs#49059 Refs: nodejs#49110 PR-URL: nodejs#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit moves the global after() hook execution from the 'beforeExit' event to the point where all tests have finished running. This gives the global after() a chance to clean up handles that would otherwise prevent the 'beforeExit' event from being emitted. PR-URL: nodejs#49059 Fixes: nodejs#49056 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (nodejs#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs#49059 Refs: nodejs#49110 PR-URL: nodejs#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (#49059 (comment)) and an additional common.mustCall() in the added test. Refs: #49059 Refs: #49110 PR-URL: #49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (nodejs#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs#49059 Refs: nodejs#49110 PR-URL: nodejs#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (nodejs#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs#49059 Refs: nodejs#49110 PR-URL: nodejs#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (#49059 (comment)) and an additional common.mustCall() in the added test. Refs: #49059 Refs: #49110 PR-URL: #49116 Backport-PR-URL: #49225 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656. It also includes the fix for the issue that required the revert (#49059 (comment)) and an additional common.mustCall() in the added test. Refs: #49059 Refs: #49110 PR-URL: #49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656fc627e4f48a0f706756873b593d81372a. It also includes the fix for the issue that required the revert (nodejs/node#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs/node#49059 Refs: nodejs/node#49110 PR-URL: nodejs/node#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit reverts the revert in bb52656fc627e4f48a0f706756873b593d81372a. It also includes the fix for the issue that required the revert (nodejs/node#49059 (comment)) and an additional common.mustCall() in the added test. Refs: nodejs/node#49059 Refs: nodejs/node#49110 PR-URL: nodejs/node#49116 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit moves the global
after()
hook execution from the'beforeExit'
event to the point where all tests have finished running. This gives the globalafter()
a chance to clean up handles that would otherwise prevent the'beforeExit'
event from being emitted.Fixes: #49056