mirror of
https://github.com/n8n-io/n8n.git
synced 2026-07-28 19:45:09 +02:00
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Declan Carroll <declan@n8n.io>
30 lines
898 B
TypeScript
30 lines
898 B
TypeScript
import type { N8NStartupDiagnostics } from './services/n8n';
|
|
|
|
// Module-global because the playwright `n8nContainer` worker fixture re-throws
|
|
// when `createN8NStack` fails, so dependent fixtures only see `n8nContainer ===
|
|
// undefined` and have no fixture-graph path to the captured diagnostics. Scoped
|
|
// per worker — playwright workers are separate processes.
|
|
let latestStartupFailure: {
|
|
projectName: string;
|
|
diagnostics: N8NStartupDiagnostics;
|
|
message: string;
|
|
} | null = null;
|
|
|
|
export function recordStartupFailure(
|
|
projectName: string,
|
|
diagnostics: N8NStartupDiagnostics,
|
|
message: string,
|
|
): void {
|
|
latestStartupFailure = { projectName, diagnostics, message };
|
|
}
|
|
|
|
export function consumeStartupFailure(): {
|
|
projectName: string;
|
|
diagnostics: N8NStartupDiagnostics;
|
|
message: string;
|
|
} | null {
|
|
const failure = latestStartupFailure;
|
|
latestStartupFailure = null;
|
|
return failure;
|
|
}
|