-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Start fixing bugs discovered by Node.js's Node-API tests #14501
base: main
Are you sure you want to change the base?
Conversation
… ben/fix-node-napi-tests
… ben/fix-node-napi-tests
This reverts commit 30eda1e.
… ben/fix-node-napi-tests
.windows => { | ||
std.posix.abort(); | ||
// This exit code is what Node.js uses when it calls | ||
// abort. This is relied on by their Node-API tests. | ||
bun.C.quick_exit(134); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change Node's test so it accepts whatever exit code std.posix.abort
results in?
export fn Bun__crashHandler(message_ptr: [*]u8, message_len: usize) noreturn { | ||
crashHandler(.{ .panic = message_ptr[0..message_len] }, null, @returnAddress()); | ||
} | ||
|
||
comptime { | ||
_ = &Bun__crashHandler; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unnecessary if we can get the WTF release assertions to work.
// TODO(@heimskr): get finalizers in workers working again | ||
// checkOutput(requireAs(__filename, ['--expose-gc'], runOptions, 'worker')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if this test still fails
@@ -8,6 +8,7 @@ static int cleanup_hook_count = 0; | |||
static void cleanup(void* arg) { | |||
cleanup_hook_count++; | |||
printf("cleanup(%d)\n", *(int*)(arg)); | |||
fflush(stdout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit this change in 190n/node
@@ -34,6 +34,7 @@ const failingNodeApiTests = [ | |||
"test_threadsafe_function/test.js", | |||
"test_threadsafe_function/test_legacy_uncaught_exception.js", | |||
"test_worker_buffer_callback/test.js", | |||
"test_worker_buffer_callback/test-free-called.js", // TODO(@heimskr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if we can unskip this
@@ -98,14 +104,14 @@ beforeAll(async () => { | |||
} | |||
} | |||
|
|||
const parallelism = Math.min(8, os.cpus().length); | |||
const parallelism = Math.min(8, os.cpus().length, 1 /* TODO(@heimskr): remove */); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
test/napi/node-napi.test.ts
Outdated
const start = Date.now(); | ||
|
||
async function buildOne(dir: string) { | ||
console.log(`Building in ${dir.replace(/.+node-napi-tests.test./, "")}.`, (Date.now() - start) / 1000, "s elapsed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
@@ -770,6 +770,8 @@ pub const EventLoop = struct { | |||
immediate_tasks: Queue = undefined, | |||
next_immediate_tasks: Queue = undefined, | |||
|
|||
napi_finalizer_queue: JSC.napi.Finalizer.Queue = undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely shouldn't be undefined
What does this PR do?
TODO before merging:
remove dependency on JSC change formerged JSC change insteadnapi_get_property_names
(@heimskr)Fixes #14336
Fixes #15383
Fixes #15429
Tests in
js-native-api
How did you verify your code works?
Running Node's tests