Skip to content

Commit 6b8fac2

Browse files
committed
test(cli): log windows warm launch and cli failures
1 parent 40b155c commit 6b8fac2

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎.github/workflows/checkfast-measure.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: bun run build
4747
- name: Measure cold vs warm, then the warm process tests
4848
shell: bash
49-
run: cd packages/cli && npx vitest run src/warmCheck.process.test.ts --maxWorkers=1 -t "prints what a cold" 2>&1 | tail -150 || true; echo ===DBG; cat warm-dbg.log
49+
run: cd packages/cli && npx vitest run src/warmCheck.process.test.ts --maxWorkers=1 2>&1 | tail -150 || true; echo ===DBG; cat warm-dbg.log
5050
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5151
if: always()
5252
with:

‎packages/cli/src/capture/captureCompositionFrame.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function prelaunchCompositionBrowser(
146146
const abort = new AbortController();
147147
const options = { browserGpuMode, signal: abort.signal };
148148
const key = launchKey(html, false, options);
149-
const launched = launchCompositionBrowser(html, false, options).catch(() => undefined);
149+
const launched = launchCompositionBrowser(html, false, options).catch((e) => { if (process.env.HF_WARM_DBG) process.getBuiltinModule("node:fs").appendFileSync(process.env.HF_WARM_DBG, `${Date.now()} ${process.pid} launch error ${e?.stack ?? e}\n`); return undefined; });
150150
let taken = false;
151151
const discard = async () => {
152152
if (taken) return;

‎packages/cli/src/cli.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ function exitAfterCliFailure(
460460
error: Error,
461461
): never {
462462
commandFailed = true;
463+
if (process.env.HF_WARM_DBG) process.getBuiltinModule("node:fs").appendFileSync(process.env.HF_WARM_DBG, `${Date.now()} ${process.pid} cli failure ${kind} ${error.stack}\n`);
463464
emitCliErrorEvent(kind, error);
464465
_flushSync?.();
465466
process.exit(1);

‎packages/cli/src/warmCheck.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ server.on("error", (error: NodeJS.ErrnoException) => {
140140
});
141141

142142
listen();
143-
void prelaunchBrowserForCheck(checkArgs).then(() => __dbg('prelaunched'), (e) => __dbg(`prelaunch failed ${e?.stack ?? e}`));
143+
void prelaunchBrowserForCheck(checkArgs).then(async (h) => { __dbg('prelaunch handle ' + Boolean(h)); const r = await h?.launched; __dbg('launched ' + Boolean(r) + ' connected=' + r?.browser.connected); }, (e) => __dbg(`prelaunch failed ${e?.stack ?? e}`));

0 commit comments

Comments
 (0)