Skip to content

Commit 0a75ecf

Browse files
committed
test: keep the open file limit program out of the generic HotSpot comparison
1 parent 0d09383 commit 0a75ecf

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎test/programs.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ test("env option replaces the host environment", async () => {
227227

228228
// both raise a lower soft limit to the hard one at startup, and report the raised value
229229
test("open file limit as HotSpot reports it", { skip: process.platform !== "linux" }, () => {
230-
const under = (cmd: string[]) => spawnSync("bash", ["-c", 'ulimit -S -n 4096; exec "$@"', "bash", ...cmd, "-cp", out, "FileLimit"], { encoding: "utf8" });
230+
const classes = join(root, "build", "test-limit");
231+
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" });
231233
const ref = under([hotspot("java")]);
232234
const got = under([process.execPath, join(root, "src", "node.ts")]);
233235
assert.deepEqual({ stdout: got.stdout, code: got.status }, { stdout: ref.stdout, code: ref.status });

0 commit comments

Comments
 (0)