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 2c199f7

Browse filesBrowse files
joyeecheungaduh95
authored andcommitted
test: split test-esm-wasm.js
The test has been flaking due to either timeout or calling uv_async_send on a closing/closed handle. As the test squeezes too many independent test cases in one file, split it up to avoid timing out on slower machines and aid debugging. PR-URL: #60491 Refs: https://github.com/nodejs/reliability/blob/main/reports/2025-10-29.md Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a37c01e commit 2c199f7
Copy full SHA for 2c199f7

File tree

Expand file treeCollapse file tree

40 files changed

+481
-476
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

40 files changed

+481
-476
lines changed
Open diff view settings
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that import names are properly escaped
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-escape-import-names.mjs')],
9+
{ stdout: '', stderr: '', trim: true }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that all WebAssembly global types are properly handled
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-globals-all-types.mjs')],
9+
{ stdout: '', stderr: '', trim: true }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that js-string builtins are supported
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-js-string-builtins.mjs')],
9+
{ stdout: '', stderr: '', trim: true }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that WASM modules can load and export functions correctly
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-load-exports.mjs')],
9+
{ stdout: '', stderr: '', trim: true }
10+
);
Collapse file
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Test that experimental warning is emitted for WASM module instances
2+
import '../common/index.mjs';
3+
import assert from 'node:assert';
4+
5+
import { spawnSyncAndAssert } from '../common/child_process.js';
6+
import * as fixtures from '../common/fixtures.js';
7+
8+
spawnSyncAndAssert(
9+
process.execPath,
10+
[fixtures.path('es-modules/wasm-modules.mjs')],
11+
{
12+
stderr(output) {
13+
assert.match(output, /ExperimentalWarning/);
14+
assert.match(output, /Importing WebAssembly module instances/);
15+
}
16+
}
17+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that code injection through export names is not allowed
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/export-name-code-injection.wasm')],
9+
{ stdout: '', stderr: '', trim: true }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that WASM modules can have non-identifier export names
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-non-identifier-exports.mjs')],
9+
{ stdout: '', stderr: '', trim: true }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test WASM module with invalid export name starting with 'wasm:'
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-reject-wasm-export-names.mjs')],
9+
{ status: 1, stderr: /Invalid Wasm export/ }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test WASM module with invalid import name starting with 'wasm:'
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-reject-wasm-import-names.mjs')],
9+
{ status: 1, stderr: /Invalid Wasm import name/ }
10+
);
Collapse file
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test WASM module with invalid export name starting with 'wasm-js:'
2+
import '../common/index.mjs';
3+
import { spawnSyncAndAssert } from '../common/child_process.js';
4+
import * as fixtures from '../common/fixtures.js';
5+
6+
spawnSyncAndAssert(
7+
process.execPath,
8+
['--no-warnings', fixtures.path('es-modules/test-wasm-reject-wasm-js-export-names.mjs')],
9+
{ status: 1, stderr: /Invalid Wasm export/ }
10+
);

0 commit comments

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