Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(gates): the editor's host gets a watchdog its own boot fits inside

esengine7a76ba3ef59d
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index 25a67d980..59f0010cf 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -38,6 +38,19 @@ export const WEBGPU_GAP = 'CI runs the pr tier of them on a runner of its own,'
*/
export const SCENE_WATCHDOG_MS = { webgl2: 45_000, webgpu: 120_000 };
+/**
+ * A floor for a host that starts slower than the one the 45s above was measured
+ * on. Booting the engine through the whole editor costs 12s on the CI runner
+ * (`createWebApp` alone measured 9.8s) against the engine host's ~1s, and two
+ * scenes were failed at 45s while the ones after them passed at 50.
+ */
+export const HOST_WATCHDOG_MS = { editor: 150_000 };
+
+/** How long one scene gets, for the host that draws it on the backend it names. */
+export function sceneWatchdogMs(backend, host) {
+ return Math.max(SCENE_WATCHDOG_MS[backend] ?? 45_000, HOST_WATCHDOG_MS[host] ?? 0);
+}
+
/**
* Every pixel gate. `env` is handed to desktop/scripts/headless-verify.mjs
* verbatim — an empty one is the default sprite scene.
diff --git a/tools/verify-render.mjs b/tools/verify-render.mjs
index 2f9a2eec7..da7c2df82 100644
--- a/tools/verify-render.mjs
+++ b/tools/verify-render.mjs
@@ -14,7 +14,7 @@
import path from 'node:path';
import { existsSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
-import { TIERS, SCENES, scenesAtTier, SCENE_WATCHDOG_MS } from './renderScenes.mjs';
+import { TIERS, SCENES, scenesAtTier, sceneWatchdogMs } from './renderScenes.mjs';
import { retryOnDeadGpu, deadGpuVerdict } from './lib/deadGpu.mjs';
import { runTool } from './lib/runTool.mjs';
import { requireCurrentEngine } from './lib/engineBuild.mjs';
@@ -71,7 +71,7 @@ if (BUDGET && !(Number(BUDGET) > 0)) {
// measured. A tier that outgrows its runner is a report either way; without one
// the report is a killed process, which names no scene at all.
const BUDGET_MS = Number(BUDGET || 0) * 60_000;
-const WATCHDOG_MS = SCENE_WATCHDOG_MS[BACKEND];
+const watchdogFor = (host) => sceneWatchdogMs(BACKEND, host);
// The scene's own watchdog produces a verdict, so this kill is for the launch
// that never reaches it — a whole electron start-up beyond.
const LAUNCH_MARGIN_MS = 30_000;
@@ -162,6 +162,7 @@ const seconds = (ms) => `${(ms / 1000).toFixed(1)}s`;
function runScene(scene) {
const RUNNER = 'tools/render-host/run.mjs';
+ const watchdog = watchdogFor(scene.host);
const args = XVFB
? ['-a', 'pnpm', 'exec', 'electron', RUNNER]
: ['exec', 'electron', RUNNER];
@@ -169,11 +170,11 @@ function runScene(scene) {
const r = runTool(XVFB ? 'xvfb-run' : 'pnpm', args, {
cwd: ROOT,
encoding: 'utf8',
- timeout: WATCHDOG_MS + LAUNCH_MARGIN_MS,
+ timeout: watchdog + LAUNCH_MARGIN_MS,
env: {
...process.env,
ELECTRON_DISABLE_SANDBOX: '1',
- ESTELLA_VERIFY_TIMEOUT_MS: String(WATCHDOG_MS),
+ ESTELLA_VERIFY_TIMEOUT_MS: String(watchdog),
ESTELLA_VERIFY_HOST: scene.host,
...scene.env,
},