Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7682e7e

Browse filesBrowse files
targosRafaelGSS
authored andcommitted
test: skip wasm allocation tests in workers
Refs: #62870 PR-URL: #61898 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> (cherry picked from commit fcff458)
1 parent 79262ff commit 7682e7e
Copy full SHA for 7682e7e

2 files changed

+28-3Lines changed: 28 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/wasm-allocation/test-wasm-allocation-memory64.js
+7-1Lines 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.
Collapse file

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

Copy file name to clipboardExpand all lines: test/wasm-allocation/test-wasm-allocation.js
+21-2Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,24 @@
44
// wasm memory32 with guard regions reserves 8GB of virtual address space.
55
'use strict';
66

7-
require('../common');
8-
new WebAssembly.Memory({ initial: 10, maximum: 100 });
7+
const common = require('../common');
8+
const assert = require('assert');
9+
const { isMainThread } = require('worker_threads');
10+
11+
// The first allocation should succeed.
12+
const first = new WebAssembly.Memory({ initial: 10, maximum: 100 });
13+
assert(first);
14+
15+
if (!isMainThread) {
16+
// https://github.com/nodejs/node/issues/62870
17+
common.skip('Workers terminate instead of throwing');
18+
}
19+
20+
// Subsequent allocations should eventually fail due to running out of
21+
// virtual address space.
22+
assert.throws(() => {
23+
const instances = [first];
24+
for (let i = 1; i < 30; i++) {
25+
instances.push(new WebAssembly.Memory({ initial: 10, maximum: 100 }));
26+
}
27+
}, /WebAssembly\.Memory/);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.