From 46e3f30316f62b59045486627ef197688cc37355 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 14 Aug 2026 22:52:59 -0700 Subject: [PATCH] test: wait for FFI background optimization The pointer range test creates multiple closures from the same function literals and explicitly requests synchronous optimization. V8 can also schedule concurrent recompilation for those closures. Wait for background optimization before closing the dynamic library so compiler jobs cannot outlive the fast FFI metadata they reference. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol --- test/ffi/test-ffi-fast-integer-validation.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/ffi/test-ffi-fast-integer-validation.js b/test/ffi/test-ffi-fast-integer-validation.js index 1243391ac87c..66b6866b4e47 100644 --- a/test/ffi/test-ffi-fast-integer-validation.js +++ b/test/ffi/test-ffi-fast-integer-validation.js @@ -65,6 +65,7 @@ test('fast FFI validates integer argument ranges', () => { assert.throws(() => callI64(2n ** 63n), expect); assert.throws(() => callU64(2n ** 64n), expect); } finally { + eval('%WaitForBackgroundOptimization()'); lib.close(); } }); @@ -96,6 +97,7 @@ test('fast FFI validates pointer BigInt ranges', () => { } } } finally { + eval('%WaitForBackgroundOptimization()'); lib.close(); } });