From 0f89708ad5dc0103727a28806f608fab52675c90 Mon Sep 17 00:00:00 2001 From: Ivo Horak Date: Tue, 8 Sep 2026 19:56:13 +0200 Subject: [PATCH 1/2] fix(eshost): align the module temp-dir test with running .js entries in place Commit 0637cdc stopped copying module-flagged .js entries to a .mjs twin so self/cyclic imports dedupe, but its unit test still expected the spawned entry to be the .mjs copy, so `bun run test:harness` has failed since. Assert the entry runs under its real name and that no .mjs copy is written, and drop the stale comment describing the old behavior. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CUv4hgo7tNxoWuXLDRwXS2 --- harness/src/eshost-elide/agent.elide.js | 6 +++--- harness/src/eshost-elide/agent.test.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/harness/src/eshost-elide/agent.elide.js b/harness/src/eshost-elide/agent.elide.js index 9774324..94bad60 100644 --- a/harness/src/eshost-elide/agent.elide.js +++ b/harness/src/eshost-elide/agent.elide.js @@ -124,9 +124,9 @@ class ElideAgent extends ConsoleAgent { // test262 fixture files are ES modules by suite convention, but Elide // (Node-style) treats imported `.js` as CommonJS unless the enclosing // package declares `type: module`. Mark the temp dir accordingly for - // module-flagged tests (whose entry runs as `.mjs`, unaffected by the - // package type); remove the marker for script tests, whose `.js` entry - // must keep evaluating as a classic global script. + // module-flagged tests, whose `.js` entry then parses as ESM; remove the + // marker for script tests, whose `.js` entry must keep evaluating as a + // classic global script. const pkg = path.join(path.dirname(args[0]), "package.json"); try { if (this._elideModule) { diff --git a/harness/src/eshost-elide/agent.test.ts b/harness/src/eshost-elide/agent.test.ts index 88cfc63..dbed3ff 100644 --- a/harness/src/eshost-elide/agent.test.ts +++ b/harness/src/eshost-elide/agent.test.ts @@ -84,7 +84,7 @@ test("_copyFixtures ignores specifiers that do not name real files", () => { expect(existsSync(join(dst, "missing_FIXTURE.js"))).toBe(false); }); -test("createChildProcess marks the temp dir type:module only for module tests", async () => { +test("createChildProcess marks the temp dir type:module only for module tests and runs the entry in place", async () => { const dir = mkdtempSync(join(tmpdir(), "elide-agent-tmp-")); const entry = join(dir, "t.js"); writeFileSync(entry, "// entry"); @@ -101,8 +101,10 @@ test("createChildProcess marks the temp dir type:module only for module tests", agent._elideModule = true; await agent.createChildProcess([entry]); expect(JSON.parse(readFileSync(join(dir, "package.json"), "utf8"))).toEqual({ type: "module" }); - // Module entry runs as a `.mjs` copy. - expect(spawned[0][0]).toBe(join(dir, "t.mjs")); + // The module entry runs under its real `.js` name (parsed as ESM via the marker), + // so self/cyclic imports of that file dedupe to the single entry record. + expect(spawned[0][0]).toBe(entry); + expect(existsSync(join(dir, "t.mjs"))).toBe(false); agent._elideModule = false; await agent.createChildProcess([entry]); From af4d63983293936b43b6acf2e341a541586cded8 Mon Sep 17 00:00:00 2001 From: Ivo Horak Date: Tue, 8 Sep 2026 19:56:50 +0200 Subject: [PATCH 2/2] test(harness): keep the unit suite green on a plain checkout The manifest tests guarded on the suite directory existing, but a checkout without submodules still has the empty placeholder directories, so they ran against nothing and failed. Guard on the directory being populated instead. The registry test still expected the javac jtreg case timeout to be 300s after registry.toml raised it to 900s. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CUv4hgo7tNxoWuXLDRwXS2 --- harness/src/manifest.test.ts | 12 +++++++++--- harness/src/registry.test.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/harness/src/manifest.test.ts b/harness/src/manifest.test.ts index 8837820..961a038 100644 --- a/harness/src/manifest.test.ts +++ b/harness/src/manifest.test.ts @@ -1,4 +1,10 @@ -import { existsSync, mkdtempSync, writeFileSync } from "node:fs"; +import { existsSync, mkdtempSync, readdirSync, writeFileSync } from "node:fs"; + +// A checkout without submodules still has the empty suite directories, so test the +// contents rather than the directory itself. +function populated(dir: string): boolean { + return existsSync(dir) && readdirSync(dir).length > 0; +} import { join } from "node:path"; import { tmpdir } from "node:os"; import { test, expect } from "bun:test"; @@ -57,7 +63,7 @@ test("javac langtools manifest enables the full tools/javac tree", () => { test("cpython manifest entries exist in the checked-out CPython suite", () => { const suiteRoot = `${import.meta.dir}/../../suites/cpython`; - if (!existsSync(suiteRoot)) return; + if (!populated(suiteRoot)) return; const manifest = loadManifest(`${import.meta.dir}/../../manifests/cpython-core.toml`); const groups = new Map(manifest.groups.map((group) => [group.id, group.include])); @@ -75,7 +81,7 @@ test("cpython manifest entries exist in the checked-out CPython suite", () => { test("wintertc WPT manifest includes checked-out paths when the suite exists", () => { const suiteRoot = `${import.meta.dir}/../../suites/wpt`; - if (!existsSync(suiteRoot)) return; + if (!populated(suiteRoot)) return; const manifest = loadManifest(`${import.meta.dir}/../../manifests/wintertc-wpt-2025.toml`); for (const path of manifest.groups.flatMap((group) => group.include)) { diff --git a/harness/src/registry.test.ts b/harness/src/registry.test.ts index 10c0b51..514d5a1 100644 --- a/harness/src/registry.test.ts +++ b/harness/src/registry.test.ts @@ -55,7 +55,7 @@ test("loads javac-jtreg workload from registry.toml", () => { expect(javac!.path).toBe("suites/openjdk"); expect(javac!.settings.manifest).toBe("manifests/javac-langtools.toml"); expect(javac!.settings.timeoutMs).toBe(3600000); - expect(javac!.settings.jtregCaseTimeoutSeconds).toBe(300); + expect(javac!.settings.jtregCaseTimeoutSeconds).toBe(900); expect(javac!.settings.javaRunner).toBe("java"); });