Skip to content

Commit 92676ef

Browse files
committed
test: lower the open file limit with prlimit instead of a shell
1 parent dd7285c commit 92676ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test/programs.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ test("env option replaces the host environment", async () => {
229229
test("open file limit as HotSpot reports it", { skip: process.platform !== "linux" }, () => {
230230
const classes = join(root, "build", "test-limit");
231231
execFileSync(hotspot("javac"), ["-d", classes, join(root, "test", "process", "FileLimit.java")]);
232-
const under = (cmd: string[]) => spawnSync("bash", ["-c", 'ulimit -S -n 4096; exec "$@"', "bash", ...cmd, "-cp", classes, "FileLimit"], { encoding: "utf8" });
232+
const under = ([cmd, ...args]: string[]) => spawnSync("prlimit", ["--nofile=4096:", cmd, ...args, "-cp", classes, "FileLimit"], { encoding: "utf8" });
233233
const ref = under([hotspot("java")]);
234234
const got = under([process.execPath, join(root, "src", "node.ts")]);
235235
assert.deepEqual({ stdout: got.stdout, code: got.status }, { stdout: ref.stdout, code: ref.status });

0 commit comments

Comments
 (0)