test(e2e): fix wx suite — header deps, port pinning, drop legacy-GL tests, wx+pthread worker fix

Suite went 64 failed → 291 passed / 0 failed:
- Makefile.wasm: compile with -MMD -MP and include .d files — stale objects
  relinked against a newer wx lib crashed apps at startup with "function
  signature mismatch" after any header/vtable change
- playwright(.coroutine).config.ts: pin the server port for the whole run
  (resolvePort from playwright-kicad.config.ts); the 60s freshness window made
  workers restarted after a failure rotate to a dead port (ERR_CONNECTION_REFUSED
  cascade across ~50 tests)
- drop legacy-GL testing: KiCad renders via WebGL GAL (gal-webgl.spec.ts);
  remove minimal_test's OpenGL tab/GLTestCanvas, opengl.spec.ts, GL z-order
  describes, -sLEGACY_GL_EMULATION + gl_immediate_shim.js from the test build,
  and the orphaned GL baselines
- coroutine-pthread repro apps join the `all` target (make clean used to delete
  them while all never rebuilt them); clean no longer eats checked-in JS like
  worker_dom_stub.js
- bump wxwidgets: guard module-eval document access so wx+pthread apps
  (threadpool tests) survive Web Worker eval

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-06-10 13:40:00 +02:00
commit 7629ab978d
53 changed files with 119 additions and 1060 deletions

View file

@ -23,20 +23,25 @@ function findFreePort(): number {
}
}
function getOrFindPort(): number {
try {
const stat = fs.statSync(PORT_FILE);
if (Date.now() - stat.mtimeMs < 60000) {
const port = parseInt(fs.readFileSync(PORT_FILE, 'utf-8').trim());
if (port > 0 && port < 65536) return port;
}
} catch { /* fall through */ }
// Same port-pinning scheme as playwright-kicad.config.ts: the main runner (argv
// contains `test`) always picks a fresh port and writes the file before workers
// spawn; workers — including ones recreated mid-run after a failure — always
// reuse it. No freshness window, so a recreated worker can never rotate to a
// dead port (ERR_CONNECTION_REFUSED cascade).
function resolvePort(): number {
const isMainRunner = process.argv.slice(2).includes('test');
if (!isMainRunner) {
try {
const existing = parseInt(fs.readFileSync(PORT_FILE, 'utf-8').trim(), 10);
if (existing > 0 && existing < 65536) return existing;
} catch { /* fall through */ }
}
const port = findFreePort();
fs.writeFileSync(PORT_FILE, port.toString());
return port;
}
const port = getOrFindPort();
const port = resolvePort();
export default defineConfig({
globalSetup: './global-setup.ts',