Skip to content

Commit fcff458

Browse files
committed
test: skip wasm allocation tests in workers
Refs: #62870 PR-URL: #61898 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent 61c9b76 commit fcff458

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

test/wasm-allocation/test-wasm-allocation-memory64.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
// wasm memory64 with guard regions reserves 16GB of virtual address space.
55
'use strict';
66

7-
require('../common');
7+
const common = require('../common');
88
const assert = require('assert');
9+
const { isMainThread } = require('worker_threads');
910

1011
// The first allocation should succeed.
1112
const first = new WebAssembly.Memory({ address: 'i64', initial: 10n, maximum: 100n });
1213
assert(first);
1314

15+
if (!isMainThread) {
16+
// https://github.com/nodejs/node/issues/62870
17+
common.skip('Workers terminate instead of throwing');
18+
}
19+
1420
// Subsequent allocations should eventually fail due to running out of
1521
// virtual address space. memory64 reserves 16GB per allocation (vs 8GB for
1622
// memory32), so the limit is reached even faster.

test/wasm-allocation/test-wasm-allocation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
// wasm memory32 with guard regions reserves 8GB of virtual address space.
55
'use strict';
66

7-
require('../common');
7+
const common = require('../common');
88
const assert = require('assert');
9+
const { isMainThread } = require('worker_threads');
910

1011
// The first allocation should succeed.
1112
const first = new WebAssembly.Memory({ initial: 10, maximum: 100 });
1213
assert(first);
1314

15+
if (!isMainThread) {
16+
// https://github.com/nodejs/node/issues/62870
17+
common.skip('Workers terminate instead of throwing');
18+
}
19+
1420
// Subsequent allocations should eventually fail due to running out of
1521
// virtual address space.
1622
assert.throws(() => {

0 commit comments

Comments
 (0)