Skip to content

Commit cdc3ca8

Browse files
authored
test: limit the concurrency of WPTRunner for RISC-V
For riscv64, the most commonly supported paging mode is sv39, which allocates 256GiB of virtual address space for the user space. However, due to trap handler security mechanism in V8, creating a wasm memory will cost 8GiB of continuous virtual address space. In a fresh node repl, I could only create 27 WebAssembly.Memory instances. When the virtual address space is more fragmented, it is worse. The wpt tests are randomly failing on riscv64 due to insufficient virtual address space to create wasm memories. This PR fixes it by limiting the concurrency of the WPTRunner to prevent the tests from creating too many wasm memories. PR-URL: #60591 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 22a3eb0 commit cdc3ca8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/common/wpt.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ const limit = (concurrency) => {
533533

534534
class WPTRunner {
535535
constructor(path, { concurrency = os.availableParallelism() - 1 || 1 } = {}) {
536+
// RISC-V has very limited virtual address space in the currently common
537+
// sv39 mode, in which we can only create a very limited number of wasm
538+
// memories(27 from a fresh node repl). Limit the concurrency to avoid
539+
// creating too many wasm memories that would fail.
540+
if (process.arch === 'riscv64' || process.arch === 'riscv32') {
541+
concurrency = Math.min(10, concurrency);
542+
}
543+
536544
this.path = path;
537545
this.resource = new ResourceLoader(path);
538546
this.concurrency = concurrency;

0 commit comments

Comments
 (0)