From 8ab6a6c67dcf6fe14248be59d054d6ff17490138 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 1 Mar 2021 14:32:22 -0500 Subject: [PATCH] test: fix wasi/test-return-on-exit on 32-bit systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting with the V8 8.8 update, this test has been regularly crashing with an out of memory error on 32-bit Windows. The issue has been narrowed down to a function not being bound. This seems like a V8 bug, but at least it seems that we can work around it. Fixes: https://github.com/nodejs/node/issues/37374 PR-URL: https://github.com/nodejs/node/pull/37615 Reviewed-By: Rich Trott Reviewed-By: Michaƫl Zasso --- test/wasi/test-return-on-exit.js | 3 ++- test/wasi/wasi.status | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/wasi/test-return-on-exit.js b/test/wasi/test-return-on-exit.js index 362d13b490a96f..e61f4174c3d4ee 100644 --- a/test/wasi/test-return-on-exit.js +++ b/test/wasi/test-return-on-exit.js @@ -21,7 +21,8 @@ const buffer = fs.readFileSync(modulePath); // Verify that if a WASI application throws an exception, Node rethrows it // properly. const wasi = new WASI({ returnOnExit: true }); - wasi.wasiImport.proc_exit = () => { throw new Error('test error'); }; + const patchedExit = () => { throw new Error('test error'); }; + wasi.wasiImport.proc_exit = patchedExit.bind(wasi.wasiImport); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; const { instance } = await WebAssembly.instantiate(buffer, importObject); diff --git a/test/wasi/wasi.status b/test/wasi/wasi.status index 0968d131cdf2f1..12212e8f72822b 100644 --- a/test/wasi/wasi.status +++ b/test/wasi/wasi.status @@ -5,7 +5,3 @@ prefix wasi # sample-test : PASS,FLAKY [true] # This section applies to all platforms - -[$system==win32] -# https://github.com/nodejs/node/pull/36139 -test-return-on-exit: PASS,FLAKY