node/test/js-native-api
Joyee Cheung 627d3993f0
test: fix unreliable assumption in js-native-api/test_cannot_run_js
Previously the test assumes that when the queued finalizer is run,
it must be run at a point where env->can_call_into_js() is false
(typically, during Environment shutdown), which is not certain.
If GC kicks in early and the second pass finalizer is queued before
the event loop runs the check callbacks, the finalizer would then
be called in check callbacks (via native immediates), where
the finalizer can still call into JS. Essentially, addons can't
make assumptions about where the queued finalizer would be called.
This patch updates the assertions in the test to account for that.

PR-URL: https://github.com/nodejs/node/pull/51898
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-09-26 13:38:46 +00:00
..
2_function_arguments test: avoid copying test source files 2023-11-27 11:57:14 +01:00
3_callbacks test: avoid copying test source files 2023-11-27 11:57:14 +01:00
4_object_factory test: avoid copying test source files 2023-11-27 11:57:14 +01:00
5_function_factory test: avoid copying test source files 2023-11-27 11:57:14 +01:00
6_object_wrap test: avoid copying test source files 2023-11-27 11:57:14 +01:00
7_factory_wrap test: avoid copying test source files 2023-11-27 11:57:14 +01:00
8_passing_wrapped test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_array test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_bigint test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_cannot_run_js test: fix unreliable assumption in js-native-api/test_cannot_run_js 2024-09-26 13:38:46 +00:00
test_constructor test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_conversions test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_dataview test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_date test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_error test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_exception test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_finalizer node-api: segregate nogc APIs from rest via type system 2024-03-22 16:04:52 +00:00
test_function test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_general test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_handle_scope test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_instance_data test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_new_target test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_number test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_object test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_promise test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_properties test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_reference node-api: enable uncaught exceptions policy by default 2023-11-27 11:57:14 +01:00
test_reference_double_free test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_string node-api: segregate nogc APIs from rest via type system 2024-03-22 16:04:52 +00:00
test_symbol test: avoid copying test source files 2023-11-27 11:57:14 +01:00
test_typedarray test: avoid copying test source files 2023-11-27 11:57:14 +01:00
.gitignore test: ignore the copied entry_point.c 2023-08-29 17:17:52 -04:00
common-inl.h test: avoid copying test source files 2023-11-27 11:57:14 +01:00
common.h node-api: segregate nogc APIs from rest via type system 2024-03-22 16:04:52 +00:00
entry_point.h test: avoid copying test source files 2023-11-27 11:57:14 +01:00
testcfg.py test: partition N-API tests 2018-12-04 13:58:17 -08:00