Skip to content
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

Merged
merged 278 commits into from
Feb 27, 2025

Conversation

190n
Copy link
Contributor

@190n 190n commented Oct 12, 2024

What does this PR do?

TODO before merging:

  • Get these tests running in CI
  • get other new tests to run from napi.test.ts
  • fix leak test
  • remove dependency on JSC change for napi_get_property_names (@heimskr) merged JSC change instead

Fixes #14336
Fixes #15383
Fixes #15429
Fixes #17503

Tests in js-native-api

  • 2_function_arguments/test.js
  • 3_callbacks/test.js
  • 4_object_factory/test.js
  • 5_function_factory/test.js
  • 6_object_wrap/test-object-wrap-ref.js
  • 6_object_wrap/test.js
  • 7_factory_wrap/test.js
  • 8_passing_wrapped/test.js
  • test_array/test.js
  • test_bigint/test.js
  • test_cannot_run_js/test.js
  • test_constructor/test.js
  • test_constructor/test2.js
  • test_constructor/test_null.js
  • test_conversions/test.js
  • test_dataview/test.js
  • test_date/test.js
  • test_error/test.js
  • test_exception/test.js
  • test_exception/testFinalizerException.js
  • test_finalizer/test.js
  • test_finalizer/test_fatal_finalize.js
  • test_function/test.js
  • test_general/test.js
  • test_general/testEnvCleanup.js
  • test_general/testFinalizer.js
  • test_general/testGlobals.js
  • test_general/testInstanceOf.js
  • test_general/testNapiRun.js
  • test_general/testNapiStatus.js
  • test_handle_scope/test.js
  • test_instance_data/test.js
  • test_new_target/test.js
  • test_number/test.js
  • test_number/test_null.js
  • test_object/test.js
  • test_object/test_exceptions.js
  • test_object/test_null.js
  • test_promise/test.js
  • test_properties/test.js
  • test_reference/test.js
  • test_reference/test_finalizer.js
  • test_reference_double_free/test.js
  • test_reference_double_free/test_wrap.js
  • test_string/test.js
  • test_string/test_null.js
  • test_symbol/test1.js
  • test_symbol/test2.js
  • test_symbol/test3.js
  • test_typedarray/test.js

How did you verify your code works?

Running Node's tests

@robobun
Copy link

robobun commented Oct 12, 2024

Updated 8:03 PM PT - Feb 26th, 2025

@190n, your commit b1f78cd has 2 failures in Build #12372:


🧪   try this PR locally:

bunx bun-pr 14501

@190n 190n changed the title Fix bugs discovered by Node.js's Node-API tests Start fixing bugs discovered by Node.js's Node-API tests Oct 16, 2024
@190n 190n marked this pull request as ready for review October 16, 2024 20:55
@190n 190n marked this pull request as draft October 17, 2024 16:29
@190n 190n requested a review from Copilot February 27, 2025 04:41

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR addresses bugs discovered by Node.js's Node-API tests by updating timeouts and adjusting test settings.

  • Adds a new napiTimeout constant for Node-API tests.
  • Updates the getTestTimeout function to return the napiTimeout for paths matching "napi".

Reviewed Changes

File Description
scripts/runner.node.mjs Introduces napiTimeout and updates test timeout logic.

Copilot reviewed 341 out of 341 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

scripts/runner.node.mjs:51

  • [nitpick] Consider adding an inline comment describing that this constant sets the timeout for Node-API tests and clarifying the units (milliseconds) for better readability.
const napiTimeout = 10 * 60_000;

scripts/runner.node.mjs:684

  • [nitpick] Consider adding a comment to clarify that the regex match is intended to identify Node-API tests, ensuring that future maintainers understand the context of this branch in the timeout logic.
if (/napi/i.test(testPath)) {
@Jarred-Sumner Jarred-Sumner merged commit efabdcb into main Feb 27, 2025
68 of 70 checks passed
@Jarred-Sumner Jarred-Sumner deleted the ben/fix-node-napi-tests branch February 27, 2025 06:11
@190n 190n mentioned this pull request Feb 28, 2025
2 tasks
@190n 190n added the release-notes This PR should be mentioned in release notes for the Bun version in which it lands label Mar 1, 2025
@190n 190n mentioned this pull request Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes This PR should be mentioned in release notes for the Bun version in which it lands
Projects
None yet
6 participants