-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
test_runner: cleanup test timeout abort listener #48915
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
Merged
nodejs-github-bot
merged 13 commits into
nodejs:main
from
rluvaton:hooks-generate-MaxListenersExceededWarning
Jul 31, 2023
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
272ff66
test_runner: cleanup test timeout abort listener
rluvaton 8657bc3
added test
rluvaton f19a8c2
fix with custom timeout as well
rluvaton eaf2fa2
add snapshot
rluvaton 9428261
fix timers too many listeners as well
rluvaton 443cd6c
fix
rluvaton d38b81c
use SymbolDispose
rluvaton 1adfbe3
trigger ci
rluvaton c0ee1e0
rename
rluvaton 8fc0373
remove the use of `SymbolDispose` and `addAbortListener` so we can ba…
rluvaton 6df6aef
use ObjectDefineProperty
rluvaton 397fe49
used @MoLow suggestion
rluvaton 4c2c0bd
used `ObjectDefineProperty`
rluvaton 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 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
8 changes: 8 additions & 0 deletions
8
test/fixtures/test-runner/output/before-and-after-each-too-many-listeners.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
const { beforeEach, afterEach, test} = require("node:test"); | ||
beforeEach(() => {}); | ||
afterEach(() => {}); | ||
|
||
for (let i = 1; i <= 11; ++i) { | ||
test(`${i}`, () => {}); | ||
} |
65 changes: 65 additions & 0 deletions
65
test/fixtures/test-runner/output/before-and-after-each-too-many-listeners.snapshot
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
TAP version 13 | ||
# Subtest: 1 | ||
ok 1 - 1 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 2 | ||
ok 2 - 2 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 3 | ||
ok 3 - 3 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 4 | ||
ok 4 - 4 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 5 | ||
ok 5 - 5 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 6 | ||
ok 6 - 6 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 7 | ||
ok 7 - 7 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 8 | ||
ok 8 - 8 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 9 | ||
ok 9 - 9 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 10 | ||
ok 10 - 10 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 11 | ||
ok 11 - 11 | ||
--- | ||
duration_ms: * | ||
... | ||
1..11 | ||
# tests 11 | ||
# suites 0 | ||
# pass 11 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
8 changes: 8 additions & 0 deletions
8
test/fixtures/test-runner/output/before-and-after-each-with-timeout-too-many-listeners.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
const { beforeEach, afterEach, test} = require("node:test"); | ||
beforeEach(() => {}, {timeout: 10000}); | ||
afterEach(() => {}, {timeout: 10000}); | ||
|
||
for (let i = 1; i <= 11; ++i) { | ||
test(`${i}`, () => {}); | ||
} |
65 changes: 65 additions & 0 deletions
65
...ixtures/test-runner/output/before-and-after-each-with-timeout-too-many-listeners.snapshot
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
TAP version 13 | ||
# Subtest: 1 | ||
ok 1 - 1 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 2 | ||
ok 2 - 2 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 3 | ||
ok 3 - 3 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 4 | ||
ok 4 - 4 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 5 | ||
ok 5 - 5 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 6 | ||
ok 6 - 6 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 7 | ||
ok 7 - 7 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 8 | ||
ok 8 - 8 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 9 | ||
ok 9 - 9 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 10 | ||
ok 10 - 10 | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: 11 | ||
ok 11 - 11 | ||
--- | ||
duration_ms: * | ||
... | ||
1..11 | ||
# tests 11 | ||
# suites 0 | ||
# pass 11 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
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
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.
Uh oh!
There was an error while loading. Please reload this page.