add ListenerRefusalError and ListenerLeakError which get logged when listener thresholds are exceeded. (#212900)

* add `ListenerRefusalError` and `ListenerLeakError` which get logged when listener thresholds are exceeded.

The `stack` property of these errors will point towards the most frequent listener and how often it is used. If that's a high number there is a leak (same listener is added over and over again), if that's a low number there might be a conceptual flaw that an emitter is simply too prominent.

* rightfully don't use Error.captureStackTrace (v8/nodejs only)
This commit is contained in:
Johannes Rieken
2024-05-16 17:29:17 +02:00
committed by GitHub
parent e65febca09
commit 2d97803568
3 changed files with 83 additions and 16 deletions
+2 -1
View File
@@ -199,7 +199,8 @@ async function loadTests(opts) {
'issue #149130: vscode freezes because of Bracket Pair Colorization', // https://github.com/microsoft/vscode/issues/192440
'property limits', // https://github.com/microsoft/vscode/issues/192443
'Error events', // https://github.com/microsoft/vscode/issues/192443
'fetch returns keybinding with user first if title and id matches' //
'fetch returns keybinding with user first if title and id matches', //
'throw ListenerLeakError'
]);
let _testsWithUnexpectedOutput = false;