Repository navigation
Flaky js-native-api/test_cannot_run_js/test #48180
Description
Activity
- addedflaky-testIssues and PRs involving tests that fail intermittently in CI.Issues and PRs involving tests that fail intermittently in CI.
on May 25, 2023 - addedlinuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.macosIssues and PRs related to the macOS platform.Issues and PRs related to the macOS platform.
on May 25, 2023 - added a commit that references this issue
on May 27, 2023 - added a commit that references this issue
on May 30, 2023 - added a commit that references this issue
on Jul 6, 2023 - added a commit that references this issue
on Jul 6, 2023 - added 2 commits that reference this issue
on Aug 14, 2023 I think this issue is showing up again I've seen it on the following platforms:
AIX: https://ci.nodejs.org/view/All/job/node-test-commit-aix/50418/nodes=aix72-ppc64/testReport/js-native-api/test_cannot_run_js/test_/
IBM i : https://ci.nodejs.org/job/node-test-commit-ibmi/nodes=ibmi73-ppc64/1466/testReport/js-native-api/test_cannot_run_js/test_/This issue should not have been closed -- #48181 merely marked the test as flaky.
I've added a log to check what the actual and expected values are before we abort.
This was done on IBM i:
node/test/js-native-api/test_cannot_run_js/test_cannot_run_js.c
Lines 15 to 19 in 847b9e0
if (napi_get_global(env, &global) != napi_ok) abort(); if (napi_get_named_property(env, global, "setTimeout", &set_timeout) != expected_status) abort(); free(ref); diff --git a/test/js-native-api/test_cannot_run_js/test_cannot_run_js.c b/test/js-native-api/test_cannot_run_js/test_cannot_run_js.c index c495f8780d..3ed3ee97fb 100644 --- a/test/js-native-api/test_cannot_run_js/test_cannot_run_js.c +++ b/test/js-native-api/test_cannot_run_js/test_cannot_run_js.c @@ -14,9 +14,12 @@ static void Finalize(napi_env env, void* data, void* hint) { if (napi_delete_reference(env, *ref) != napi_ok) abort(); if (napi_get_global(env, &global) != napi_ok) abort(); - if (napi_get_named_property(env, global, "setTimeout", &set_timeout) != - expected_status) + + napi_status actual_status = napi_get_named_property(env, global, "setTimeout", &set_timeout); + if (actual_status != expected_status){ + fprintf(stderr, "actual_status (%d) != expected_status(%d)\n", actual_status, expected_status); abort(); + } free(ref); }
$ ./out/Release/node test/js-native-api/test_cannot_run_js/test.js actual_status (0) != expected_status(10) IOT/Abort trap (core dumped)
Looks like the actual napi_status value is
0but the expected status is10. 🤔From the docs napi_status is a enum an 0 should map to -> napi_ok and 10 would map to -> napi_pending_exception
- linked a pull request that will close this issuetest: fix unreliable assumption in js-native-api/test_cannot_run_js #51898
on Feb 27, 2024 - addednode-apiIssues and PRs related to Node-API.Issues and PRs related to Node-API.
on Feb 28, 2024
Test
js-native-api/test_cannot_run_js/test
Platform
Linux ARM64, Linux x64, macOS ARM64, macOS x64
Console output
crashed (-6)Build links
See reliability report: nodejs/reliability#576
Here's one example: https://ci.nodejs.org/job/node-test-binary-armv7l/5897/RUN_SUBSET=native,nodes=ubuntu2004-armv7l/testReport/junit/js-native-api/test_cannot_run_js/test/
Additional information
Newly added in #47986
Probably comes from this abort statement:
node/test/js-native-api/test_cannot_run_js/test_cannot_run_js.c
Line 18 in 847b9e0
Could not reproduce locally with test.py. Weirdly it reproduces every time when run without test.py: