summaryrefslogtreecommitdiff
path: root/test/report
Commit message (Collapse)AuthorAgeFilesLines
* test: add lint rule to enforce trailing commasAntoine du Hamel2022-11-172-3/+3
| | | | | | | | | | | Only activated on some subfolders to minimize the diff, ideally this rule would be applied gradually to the entire codebase in follow-up commits. PR-URL: https://github.com/nodejs/node/pull/45468 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* report: fix missing section javascriptHeap on OOMErrorlegendecas2022-09-025-20/+27
| | | | | | | | | | | | | | `Environment::GetCurrent` may not available in the context of OOM. Removes the cyclic `Environment::GetCurrent` and `env->isolate()` calls to ensure both `isolate` and `env` is present if available. However, this behavior is not guaranteed. As `Environment::GetCurrent` didn't allocate new handles in the heap, when a Context is entered it can still get the valid env pointer. Removes the unstable assertion of the absence of env in the test. PR-URL: https://github.com/nodejs/node/pull/44398 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
* test: split report OOM testsJoyee Cheung2022-08-296-123/+174
| | | | | | | | | | | | On some machines the report OOM tests can take too long to complete, resulting in a timeout. This splits the test into several different smaller tests to reduce the flakiness of it. PR-URL: https://github.com/nodejs/node/pull/44389 Refs: https://github.com/nodejs/reliability/issues/356 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* report: add queue info for udptheanarkh2022-08-241-0/+2
| | | | | PR-URL: https://github.com/nodejs/node/pull/44345 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* report: print javascript stack on fatal errorlegendecas2022-08-201-1/+3
| | | | | | | | | | | Try to print JavaScript stack on fatal error. OOMError needs to be distinguished from fatal error since no new handle can be created at that time. PR-URL: https://github.com/nodejs/node/pull/44242 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* report: skip report if uncaught exception is handledChengzhong Wu2022-08-166-36/+108
| | | | | | | | | | | If the exception is handled by the userland process#uncaughtException handler, reports should not be generated repetitively as the process may continue to run. PR-URL: https://github.com/nodejs/node/pull/44208 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
* test: mark flaky tests on smartosFeng Yu2022-06-281-0/+11
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/43596 Refs: https://github.com/nodejs/node/issues/43457 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
* test: avoid deep comparisons with literalsTobias Nießen2021-11-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comparing any value to any non-RegExp literal or undefined using strictEqual (or notStrictEqual) passes if and only if deepStrictEqual (or notDeepStrictEqual, respectively) passes. Unnecessarily using deep comparisons adds confusion. This patch adds an ESLint rule that forbids the use of deepStrictEqual and notDeepStrictEqual when the expected value (i.e., the second argument) is a non-RegExp literal or undefined. For reference, an ESTree literal is defined as follows. extend interface Literal <: Expression { type: "Literal"; value: string | boolean | null | number | RegExp | bigint; } The value `undefined` is an `Identifier` with `name: 'undefined'`. PR-URL: https://github.com/nodejs/node/pull/40634 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
* src: write named pipe info in diagnostic reportlegendecas2021-05-213-45/+138
| | | | | | | | | | | Writes pipe handles with `uv_pipe_getsockname()` and `uv_pipe_getpeername()`. PR-URL: https://github.com/nodejs/node/pull/38637 Fixes: https://github.com/nodejs/node/issues/38625 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* src: print arbitrary javascript exception value in node reportlegendecas2021-04-262-0/+50
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/38009 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* test: remove unneeded m flag on regular expressionsRich Trott2021-04-091-3/+3
| | | | | | | | | | | | | The m flag has no effect on regular expressions that don't match the start or the end of a line. PR-URL: https://github.com/nodejs/node/pull/38124 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test: prepare for consistent comma-dangle lint ruleRich Trott2021-04-011-2/+2
| | | | | | | | | Make changes so that tests will pass when the comma-dangle settings applied to the rest of the code base are also applied to tests. PR-URL: https://github.com/nodejs/node/pull/37930 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
* src: add loop idle time in diagnostic reportGireesh Punathil2020-11-131-0/+3
| | | | | | | | | | | | Add libuv's cumulative idle time in the diagnostic report. Add the data under the libuv's loop section Refs: https://github.com/nodejs/node/pull/34938 PR-URL: https://github.com/nodejs/node/pull/35940 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
* lib: honor setUncaughtExceptionCaptureCallbackGireesh Punathil2020-10-151-0/+26
| | | | | | | | | | | | | | This api does not alter the behavior of diagnostic report configured on uncaught exceptions. This is deemed as a bug. Honor this API. Refs: https://github.com/nodejs/node/pull/35588 PR-URL: https://github.com/nodejs/node/pull/35595 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
* src: add errorProperties on process.reporthimself652020-06-262-1/+15
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28426 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* report: fix stderr matching for fatal errorgengjiawen2020-04-091-2/+2
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/32699 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
* src: handle report options on fatalerrorSam Roberts2020-03-311-17/+93
| | | | | | | | | | | Follow on to https://github.com/nodejs/node/pull/32207, 3 other options are also not respected under situations that the isolate is not available. PR-URL: https://github.com/nodejs/node/pull/32497 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* report: handle on-fatalerror betterHarshitha KP2020-03-251-14/+23
| | | | | | | | | | | | | | | | --report-on-fatalerror was not honored properly, as there was no way to check the value which was stored in the Environment pointer which can be inaccessible under certain fatal error situations. Move the flag out of Environment pointer so that this is doable. Co-authored-by: Shobhit Chittora schittora@paypal.com PR-URL: https://github.com/nodejs/node/pull/32207 Fixes: https://github.com/nodejs/node/issues/31576 Refs: https://github.com/nodejs/node/pull/29881 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
* src,cli: support compact (one-line) JSON reportsSam Roberts2020-03-172-1/+17
| | | | | | | | | | | | | Multi-line JSON is more human readable, but harder for log aggregators to consume, they usually require a log message per line, particularly for JSON. Compact output will be consumable by aggregators such as EFK (Elastic Search-Fluentd-Kibana), LogDNA, DataDog, etc. PR-URL: https://github.com/nodejs/node/pull/32254 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* doc,lib,src,test: make --experimental-report a nopcjihrig2020-03-158-39/+11
| | | | | | | | | | | | This commit makes the --experimental-report CLI flag a no-op. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* test: remove common.skipIfReportDisabled()cjihrig2020-03-158-8/+1
| | | | | | | | | | | | | The report feature won't ever be disabled moving forward, so checking for its existence in the tests is no longer needed. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* test: verify threadId in reportsDylan Coakley2020-01-311-0/+1
| | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31556 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* report: add support for WorkersAnna Henningsen2020-01-211-0/+50
| | | | | | | | | | | | | | | Include a report for each sub-Worker of the current Node.js instance. This adds a feature that is necessary for eventually making the report feature stable, as was discussed during the last collaborator summit. Refs: https://github.com/openjs-foundation/summit/pull/240 PR-URL: https://github.com/nodejs/node/pull/31386 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: refactor common.expectsErrorRuben Bridgewater2019-12-313-11/+11
| | | | | | | | | | | | | | | | | | | | | | | This completely refactors the `expectsError` behavior: so far it's almost identical to `assert.throws(fn, object)` in case it was used with a function as first argument. It had a magical property check that allowed to verify a functions `type` in case `type` was passed used in the validation object. This pattern is now completely removed and `assert.throws()` should be used instead. The main intent for `common.expectsError()` is to verify error cases for callback based APIs. This is now more flexible by accepting all validation possibilites that `assert.throws()` accepts as well. No magical properties exist anymore. This reduces surprising behavior for developers who are not used to the Node.js core code base. This has the side effect that `common` is used significantly less frequent. PR-URL: https://github.com/nodejs/node/pull/31092 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* test: skip the unsupported test cases for IBM iXu Meng2019-12-251-0/+3
| | | | | | | | | This is a following PR of #30714. PR-URL: https://github.com/nodejs/node/pull/30819 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* report: modify getReport() to return an ObjectChristopher Hiller2019-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | It's likely that anyone using `process.report.getReport()` will be processing the return value thereafter (e.g., filtering fields or redacting secrets). This change eliminates boilerplate by calling `JSON.parse()` on the return value. Also modified the `validateContent()` and `validate()` test helpers in `test/common/report.js` to be somewhat more obvious and helpful. Of note, a report failing validation will now be easier (though still not _easy_) to read when prepended to the stack trace. - Refs: https://github.com/nodejs/diagnostics/issues/315 PR-URL: https://github.com/nodejs/node/pull/28630 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: check getReport when error with one line stackhimself652019-07-051-0/+8
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28433 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* test: check writeReport when error with one line stackhimself652019-07-051-0/+8
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28433 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* test: better output for test-report-uv-handles.jsgengjiawen2019-05-011-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27479 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* report: print common items first for readabilitygengjiawen2019-04-271-0/+16
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27367 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* lib: replace --diagnostic-report-* with --report-*Joyee Cheung2019-04-225-5/+5
| | | | | | | | | | | In the code base the word `report` is almost only used to refer to the diagnostic report when it's a noun, and it's programmable interface `process.report()` it not prefixed, so `report` should be unambiguous enough to use without `diagnostic`. PR-URL: https://github.com/nodejs/node/pull/27312 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* report: improve signal name validationcjihrig2019-04-101-1/+10
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27137 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* report: add support for UDP connected socketsRichard Lau2019-04-051-4/+19
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/27072 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
* report: rename triggerReport() to writeReport()cjihrig2019-03-101-11/+11
| | | | | | | | writeReport() is more descriptive of what the function does. PR-URL: https://github.com/nodejs/node/pull/26527 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* test: cover triggerReport() failure casecjihrig2019-03-101-0/+16
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/26524 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: cover stdout/stderr usage in triggerReport()cjihrig2019-03-101-0/+25
| | | | | | | | | | This commit adds coverage for the cases where process.report.filename is 'stdout' or 'stderr'. PR-URL: https://github.com/nodejs/node/pull/26522 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: refactor test/report/test-report-signal.jscjihrig2019-03-071-70/+27
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/26446 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* test: relax timer check in test-report-uv-handles.jsRichard Lau2019-03-061-1/+2
| | | | | | | | | | | | The underlying JavaScript runtime may schedule tasks at its discretion so there may be more timer handles than the one created by the test. PR-URL: https://github.com/nodejs/node/pull/26434 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* report: refactor configuration managementcjihrig2019-03-054-5/+93
| | | | | | | | | | This commit removes process.report.setOptions(). Instead of using complex configuration synchronization between C++ and JS, this commit introduces individual getters and setters. PR-URL: https://github.com/nodejs/node/pull/26414 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com>
* test: rename node-report suite to reportcjihrig2019-03-027-0/+414
This commit renames the "node-report" test suite to "report" in order to begin differentiating core's diagnostic reporting from the original node-report module on npm PR-URL: https://github.com/nodejs/node/pull/26371 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>