mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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: https://github.com/nodejs/node/pull/60591 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
@@ -533,6 +533,14 @@ const limit = (concurrency) => {
|
||||
|
||||
class WPTRunner {
|
||||
constructor(path, { concurrency = os.availableParallelism() - 1 || 1 } = {}) {
|
||||
// RISC-V has very limited virtual address space in the currently common
|
||||
// sv39 mode, in which we can only create a very limited number of wasm
|
||||
// memories(27 from a fresh node repl). Limit the concurrency to avoid
|
||||
// creating too many wasm memories that would fail.
|
||||
if (process.arch === 'riscv64' || process.arch === 'riscv32') {
|
||||
concurrency = Math.min(10, concurrency);
|
||||
}
|
||||
|
||||
this.path = path;
|
||||
this.resource = new ResourceLoader(path);
|
||||
this.concurrency = concurrency;
|
||||
|
||||
Reference in New Issue
Block a user