Skip to content

QVAC-18149: Improve addon-cpp testing, fix JS callback lifetime, expose/workaround bare double creation issue, harden addon-cpp workflows#1825

Merged
gianni-cor merged 11 commits into
mainfrom
temp-js_addon_cpp_callback_issue
May 1, 2026
Merged

QVAC-18149: Improve addon-cpp testing, fix JS callback lifetime, expose/workaround bare double creation issue, harden addon-cpp workflows#1825
gianni-cor merged 11 commits into
mainfrom
temp-js_addon_cpp_callback_issue

Conversation

@jesusmb1995

@jesusmb1995 jesusmb1995 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

JS Double Issue

on this test:

https://github.com/tetherto/qvac/actions/runs/25158571461/job/73746732241
2026-04-30T09:47:36.6098023Z # first js_create_double returns the requested value on win32
2026-04-30T09:47:36.6257782Z     not ok 1 - first js_create_double returns 2
2026-04-30T09:47:36.6259451Z       ---
2026-04-30T09:47:36.6259796Z       actual: 1.094924158645e-311
2026-04-30T09:47:36.6260229Z       expected: 2
2026-04-30T09:47:36.6260555Z       operator: is
2026-04-30T09:47:36.6260777Z       source: |
2026-04-30T09:47:36.6260980Z         
2026-04-30T09:47:36.6261454Z           t.is(addon.createDouble(2), 2, 'first js_create_double returns 2')
2026-04-30T09:47:36.6261882Z         ----^
2026-04-30T09:47:36.6262744Z           t.is(addon.createDouble(3), 3, 'second js_create_double returns 3')
2026-04-30T09:47:36.6263560Z         })
2026-04-30T09:47:36.6263776Z       stack: |
2026-04-30T09:47:36.6264881Z         Object.explain (file:///D:/a/qvac/qvac/packages/qvac-lib-inference-addon-cpp/tests/integration_js/js-create-double-first-call/node_modules/brittle/lib/errors.js:20:15)
2026-04-30T09:47:36.6266818Z         explain (file:///D:/a/qvac/qvac/packages/qvac-lib-inference-addon-cpp/tests/integration_js/js-create-double-first-call/node_modules/brittle/index.js:840:34)
2026-04-30T09:47:36.6268398Z         Test._is (file:///D:/a/qvac/qvac/packages/qvac-lib-inference-addon-cpp/tests/integration_js/js-create-double-first-call/node_modules/brittle/index.js:436:25)
2026-04-30T09:47:36.6271338Z         file:///D:/a/qvac/qvac/packages/qvac-lib-inference-addon-cpp/tests/integration_js/js-create-double-first-call/test.js:14:5
2026-04-30T09:47:36.6273370Z         Test._run (file:///D:/a/qvac/qvac/packages/qvac-lib-inference-addon-cpp/tests/integration_js/js-create-double-first-call/node_modules/brittle/index.js:597:13)
2026-04-30T09:47:36.6274151Z       ...
2026-04-30T09:47:36.6274430Z     ok 2 - second js_create_double returns 3
2026-04-30T09:47:36.6274957Z not ok 1 - first js_create_double returns the requested value on win32 # time = 16ms
2026-04-30T09:47:36.6275320Z 
2026-04-30T09:47:36.6275553Z # first js_create_int32 returns the requested value on win32
2026-04-30T09:47:36.6275969Z     ok 1 - first js_create_int32 returns 2
2026-04-30T09:47:36.6276320Z     ok 2 - second js_create_int32 returns 3
2026-04-30T09:47:36.6276787Z ok 2 - first js_create_int32 returns the requested value on win32 # time = 0ms
2026-04-30T09:47:36.6277119Z 
2026-04-30T09:47:36.6277189Z 1..2
2026-04-30T09:47:36.6277565Z # tests = 1/2 pass
2026-04-30T09:47:36.6277898Z # asserts = 3/4 pass
2026-04-30T09:47:36.6278340Z # time = 18ms

Manual CI run: https://github.com/tetherto/qvac/actions/runs/25158571461/job/73746732241 exposing failure.

@jesusmb1995 jesusmb1995 force-pushed the temp-js_addon_cpp_callback_issue branch from 3a9819d to 3be07bc Compare April 30, 2026 09:57
@jesusmb1995 jesusmb1995 changed the title QVAC-18149: Improve addon-cpp testing, fix JS callback lifetime, expose bare double creation issue QVAC-18149: Improve addon-cpp testing, fix JS callback lifetime, expose/workaround bare double creation issue Apr 30, 2026
@jesusmb1995 jesusmb1995 force-pushed the temp-js_addon_cpp_callback_issue branch from bd17475 to 2036b2c Compare April 30, 2026 10:17
@gianni-cor

This comment has been minimized.

@jesusmb1995

This comment has been minimized.

Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp-js.yml Fixed
Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp-js.yml Fixed
Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp-js.yml Fixed
Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp-js.yml Fixed
@jesusmb1995

Copy link
Copy Markdown
Contributor Author

@jesusmb1995

Copy link
Copy Markdown
Contributor Author

Proletter
Proletter previously approved these changes Apr 30, 2026
@gianni-cor

This comment has been minimized.

Run addon JS integration packages across desktop targets so callback lifetime and platform-specific runtime issues are exercised in PR checks.
Keep callback state alive until the libuv async handle is closed so pending JS output delivery cannot observe freed addon storage during teardown.
Add a minimal integration package that exercises first double creation through js::Number and keeps js_create_int32 as a control across the JS test matrix.
Route addon double creation through js::Number so win32 can burn the first js_create_double call observed to produce an invalid value on GitHub Azure runners.
Use a function-local static initializer for the Windows-only js_create_double burn-in. This keeps the workaround process-wide without carrying template-level atomic state before returning the requested double value.
Limit the addon-cpp JS PR tests to read-only repository access and avoid release secrets, inherited secrets, and persisted checkout credentials. Install fixture dependencies without lifecycle scripts so PR-controlled package code cannot run during setup.
Run addon-cpp JS tests from the unprivileged pull_request workflow so PR-controlled code is not executed from pull_request_target. Keep a lightweight verify-label gate for external forks while leaving the privileged workflow focused on authorization and native tests.
@jesusmb1995

Copy link
Copy Markdown
Contributor Author

@jesusmb1995

This comment has been minimized.

Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp.yml Fixed
Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp.yml Fixed
@jesusmb1995

Copy link
Copy Markdown
Contributor Author

Comment thread .github/workflows/pr-test-qvac-lib-inference-addon-cpp.yml Fixed
Move PR-controlled native test execution out of pull_request_target so cache restore and builds run without write-capable credentials, inherited secrets, or PAT-backed checkouts.

Keep pull_request_target limited to clearing the verify label when new commits arrive, and make unverified PR events skip the native/JS matrices without failing the workflow.
@jesusmb1995

This comment was marked as resolved.

@gianni-cor

Copy link
Copy Markdown
Contributor

/review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants