[STAB-861] Suppress known-benign core dumps in CI (#21321)

### What does this PR do?

- for these kinds of aborts which we test in CI, introduce a feature
flag to suppress core dumps and crash reporting only from that abort,
and set the flag when running the test:
    - libuv stub functions
- Node-API abort (used in particular when calling illegal functions
during finalizers)
    - passing `process.kill` its own PID
- core dumps are suppressed with `setrlimit`, and crash reporting with
the new `suppress_reporting` field. these suppressions are only engaged
right before crashing, so we won't ignore new kinds of crashes that come
up in these tests.
- for the test bindings used to test the crash handler in
`run-crash-handler.test.ts`, disables core dumps but does not disable
crash reporting (because crashes get reported to a server that the test
is running to make sure they are reported)
- fixes a panic when printing source code around an error containing
`\n\r`
- updates the code where we clone vendor tests to checkout the right tag
- adds `vendor/elysia/test/path/plugin.test.ts` to
no-validate-exceptions
- this failure was exposed by starting to test the version of elysia we
have been intending to test. the crash trace suggests it may be fixed by
#21307.
- makes dumping core or uploading a crash report count as a failing test
- this ensures we don't realize a crash has occurred if it happened in a
subprocess and the main test doesn't adequately check the exit code. to
spawn a subprocess you expect to fail, prefer `expect(code).toBe(1)`
over `expect(code).not.toBe(0)`. if you really expect multiple possible
erroneous exit codes, you might try `expect(signal).toBeNull()` to still
disallow crashes.

### How did you verify your code works?

Running affected tests on a Linux machine with core dumps set up and
checking no new ones appear.

https://buildkite.com/bun/bun/builds/21465 has no core dumps.
This commit is contained in:
190n
2025-07-25 16:22:04 -07:00
committed by GitHub
parent d3927a6e09
commit 1ab76610cf
14 changed files with 132 additions and 46 deletions

View File

@@ -52,6 +52,7 @@ vendor/elysia/test/macro/macro.test.ts
vendor/elysia/test/path/group.test.ts
vendor/elysia/test/path/guard.test.ts
vendor/elysia/test/path/path.test.ts
vendor/elysia/test/path/plugin.test.ts
vendor/elysia/test/plugins/affix.test.ts
vendor/elysia/test/plugins/checksum.test.ts
vendor/elysia/test/plugins/error-propagation.test.ts