Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/bundler/native-plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BunFile, Loader } from "bun";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "bun:test";
import { bunEnv, bunExe, makeTree, tempDirWithFiles } from "harness";
import { bunEnv, bunExe, isASAN, isMusl, makeTree, tempDirWithFiles } from "harness";
import path from "path";
import bundlerPluginHeader from "../../packages/bun-native-bundler-plugin-api/bundler_plugin.h" with { type: "file" };
import source from "./native_plugin.cc" with { type: "file" };
Expand Down Expand Up @@ -407,8 +407,11 @@ const many_foo = ["foo","foo","foo","foo","foo","foo","foo"]
expect.unreachable("Should have caught an error");
});

// don't know how to reliably test this on windows
it.skipIf(process.platform === "win32")("prints name when plugin crashes", async () => {
// This test segfaults on purpose. Windows: never worked. ASAN: traps the SEGV
// and aborts before the crash handler can print the name. musl: the crash
// handler re-raises and the agent writes a core, which the runner counts as a
// failed job even though every test passed.
it.skipIf(process.platform === "win32" || isASAN || isMusl)("prints name when plugin crashes", async () => {
const prelude = /* ts */ `import values from "./stuff.ts"
const many_foo = ["foo","foo","foo","foo","foo","foo","foo"]
`;
Expand Down
4 changes: 3 additions & 1 deletion test/cli/create/create-jsx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ for (const development of [true, false]) {
});
}

test("auto-install passes detected dependencies as positionals", async () => {
// Windows: `bun create` never prints the "--only-missing install" line this
// asserts on, so the dependency detection cannot be observed there.
test.todoIf(isWindows)("auto-install passes detected dependencies as positionals", async () => {
using dir = tempDir("create-arg-separator", {
"Component.tsx": `import "--trust";

Expand Down
40 changes: 22 additions & 18 deletions test/expectations.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
# Documentation: http://trac.webkit.org/wiki/TestExpectations
# Format: [modifier] test-name [[ expectations ]] [# comment]
#
# READ THIS BEFORE ADDING AN ENTRY.
#
# An entry does ONE thing: it removes the file from the run on every platform
# the modifier matches. The runner parses the expectation kind (FAIL / SKIP /
# CRASH / FLAKY / LEAK / TIMEOUT) but never reads it — see getRelevantTests in
# scripts/runner.node.mjs. They are all the same thing, and there is no
# "run it and expect failure" mode.
#
# So: quarantining ONE broken case here silently deletes the whole file's
# coverage. If a single test is broken, skip THAT test in the file
# (test.skip / test.skipIf(isASAN) / test.todo, with a comment naming the
# failure) and do not add an entry here. Reserve this file for a file that
# cannot be run at all — it hangs, crashes the runner, or trips LeakSanitizer.
#
# Entries match by SUBSTRING, so a path prefix quarantines an entire family.
# A stale entry is invisible: the file simply never runs and nobody finds out.

# Tests that are broken
test/cli/create/create-jsx.test.ts [ FAIL ] # false > react spa (no tailwind) > build
[ WINDOWS-AARCH64 ] test/js/node/test/parallel/test-repl-close.js [ FAIL ] # EPIPE on stdin.write to closed child process
test/bundler/native-plugin.test.ts [ FAIL ] # prints name when plugin crashes
test/cli/run/run-crash-handler.test.ts [ FAIL ] # automatic crash reporter > segfault should report

# Exposed by the bun -e/--eval fix that stopped swallowing uncaught exceptions (see PR #31826):
# the spawned child needs process.binding('inspector'), which is not implemented
test/js/node/test/parallel/test-inspector-enabled.js [ FAIL ]
# The whole file's beforeAll builds a napi addon with node-gyp, and the Windows
# agents have no ClangCL toolset ("MSB8020: The build tools for ClangCL cannot
# be found"), so nothing in the file can run there. Remove once the agent image
# ships ClangCL. Runs everywhere else.
[ WINDOWS ] test/bundler/native-plugin.test.ts [ SKIP ] # node-gyp needs a ClangCL toolset the Windows agents do not have

# Verbatim node v26.3.0 test asserting a FinalizationRegistry callback fires
# within ONE globalThis.gc() + ONE setImmediate after the connect callback's
Expand Down Expand Up @@ -45,12 +60,6 @@ test/js/node/test/parallel/test-stream-wrap-encoding.js [ FAIL ] # needs interna
# Tests that are flaky
test/js/bun/spawn/spawn-maxbuf.test.ts [ FLAKY ]

# Tests skipped due to different log/line outputs
[ ASAN ] test/js/bun/util/reportError.test.ts [ SKIP ] # log line mismatch
[ ASAN ] test/js/node/child_process/child_process.test.ts [ SKIP ] # Unexpected identifier "WARNING"
[ ASAN ] test/js/bun/shell/bunshell.test.ts [ SKIP ] # bunshell > quiet > basic
[ ASAN ] test/bundler/cli.test.ts [ SKIP ] # debug logs

# Tests failed due to ASAN: attempting free on address which was not malloc()-ed
[ ASAN ] test/js/node/worker_threads/worker_threads.test.ts [ CRASH ] # After: threadId module and worker property is consistent
[ ASAN ] test/js/node/worker_threads/worker_destruction.test.ts [ CRASH ] # After: bun closes cleanly when Bun.connect is used in a Worker that is terminating
Expand Down Expand Up @@ -203,8 +212,6 @@ test/js/node/test/parallel/test-http2-util-asserts.js [ FAIL ] # not yet passing
test/js/node/test/parallel/test-http2-util-headers-list.js [ FAIL ] # not yet passing
test/js/node/test/parallel/test-http2-util-nghttp2error.js [ FAIL ] # not yet passing
test/js/node/test/parallel/test-http2-util-update-options-buffer.js [ FAIL ] # not yet passing
test/js/node/test/sequential/test-http2-timeout-large-write-file.js [ FAIL ] # not yet passing
test/js/node/test/sequential/test-http2-timeout-large-write.js [ FAIL ] # not yet passing
test/js/node/test/parallel/test-http2-autoselect-protocol.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/parallel/test-http2-client-connection-tunnelling.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/parallel/test-http2-client-jsstream-destroy.js [ SKIP ] # hangs; skip until the underlying feature lands
Expand All @@ -213,9 +220,6 @@ test/js/node/test/parallel/test-http2-max-invalid-frames.js [ SKIP ] # hangs; sk
test/js/node/test/parallel/test-http2-pack-end-stream-flag.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/parallel/test-http2-ping-unsolicited-ack.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/parallel/test-http2-session-cleanup-on-nghttp2-goaway.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/sequential/test-http2-max-session-memory.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/sequential/test-http2-ping-flood.js [ SKIP ] # hangs; skip until the underlying feature lands
test/js/node/test/sequential/test-http2-settings-flood.js [ SKIP ] # hangs; skip until the underlying feature lands

# AddressSanitizer findings under investigation on the HTTP/2 inbound path
[ ASAN ] test/js/node/test/parallel/test-diagnostics-channel-http2-client-stream-close-error.js [ SKIP ] # ASan report under investigation
Expand Down
6 changes: 6 additions & 0 deletions test/no-validate-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,9 @@ test/regression/issue/isArray-proxy-crash.test.ts

# Third-party SDK with unchecked exception path in JSArray pushInline
test/js/third_party/@azure/service-bus/azure-service-bus.test.ts

# The napi addon fixture's Init() calls napi_create_function then
# napi_set_named_property without checking the status in between, like most
# real addons. Under validateExceptionChecks every scope simulates a throw, so
# the second call trips the assertion at the napi boundary.
test/bundler/native-plugin.test.ts
6 changes: 6 additions & 0 deletions test/no-validate-leaksan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,9 @@ test/js/third_party/prisma/prisma.test.ts
# upgradeDuplexToTLS protos/server_name Box<[u8]> are owned by the JS-held
# socket cell; tests that exit before a final GC report them as indirect leaks.
test/js/node/tls/node-tls-connect.test.ts

# LSAN aborts the process at exit over an 8-byte leak in Bun's own dlopen path:
# BunProcess.cpp gives the NapiExternal holding NapiModuleMeta no finalizer
# ("TODO: think about the finalizer here"), so the meta is never freed. All 18
# tests pass; only the exit check fails. Remove once that TODO is resolved.
test/bundler/native-plugin.test.ts
Loading