diff --git a/packages/producer/src/services/distributed/__test_utils__/hostChromeFailures.ts b/packages/producer/src/services/distributed/__test_utils__/hostChromeFailures.ts new file mode 100644 index 000000000..16ba00b1b --- /dev/null +++ b/packages/producer/src/services/distributed/__test_utils__/hostChromeFailures.ts @@ -0,0 +1,24 @@ +/** + * Shared soft-skip regex used by every `services/distributed/*.test.ts` that + * drives `renderChunk()` through a real chrome-headless-shell. Matches the + * failure signatures we've observed on dev/CI hosts whose GL stack can't + * initialize: + * + * - `chrome://gpu` / `BROWSER_GPU_NOT_SOFTWARE` / SwiftShader text: + * `assertSwiftShader` can't read the gpu info table. + * - `HeadlessExperimental.beginFrame` / `Target closed`: + * chrome-headless-shell's GL process exited because the build doesn't + * honor `--use-gl=swiftshader` on the host distro (`gl_factory.cc:111` + * errors out before BeginFrame can run). + * + * Production-shaped Docker images (`Dockerfile.test` / `Dockerfile.chunk-runner`) + * carry a chrome-headless-shell build matched to the planDir's `ffmpegVersion`, + * so the determinism contract is exercised there. Tests that fail to render + * on the host soft-skip and rely on the Docker harness for ground truth. + * + * This module lives under `__test_utils__/` and is excluded from `tsc`'s + * declaration output via `tsconfig.json` so it never ships in the published + * package. + */ +export const HOST_CHROME_FAILURE_PATTERNS = + /chrome:\/\/gpu|BROWSER_GPU_NOT_SOFTWARE|SwiftShader|HeadlessExperimental\.beginFrame|Target closed/i; diff --git a/packages/producer/src/services/distributed/chunkBoundary.test.ts b/packages/producer/src/services/distributed/chunkBoundary.test.ts index 6c598c187..e701dfd8f 100644 --- a/packages/producer/src/services/distributed/chunkBoundary.test.ts +++ b/packages/producer/src/services/distributed/chunkBoundary.test.ts @@ -25,13 +25,11 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync } import { tmpdir } from "node:os"; import { dirname, join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; +import { HOST_CHROME_FAILURE_PATTERNS } from "./__test_utils__/hostChromeFailures.js"; import { assemble } from "./assemble.js"; import { plan } from "./plan.js"; import { renderChunk } from "./renderChunk.js"; -const HOST_CHROME_FAILURE_PATTERNS = - /chrome:\/\/gpu|BROWSER_GPU_NOT_SOFTWARE|SwiftShader|HeadlessExperimental\.beginFrame|Target closed/i; - // Per-adapter fixture directories under `packages/producer/tests/distributed/`. // Each must hold `src/index.html`; this test owns the planning + render + // assemble pipeline so no `output/` baseline is required. diff --git a/packages/producer/src/services/distributed/crossWorkerIdempotency.test.ts b/packages/producer/src/services/distributed/crossWorkerIdempotency.test.ts index 725450896..4d3e7ba84 100644 --- a/packages/producer/src/services/distributed/crossWorkerIdempotency.test.ts +++ b/packages/producer/src/services/distributed/crossWorkerIdempotency.test.ts @@ -26,12 +26,17 @@ import { afterAll, beforeAll, describe, expect, it } from "bun:test"; import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; +import { HOST_CHROME_FAILURE_PATTERNS } from "./__test_utils__/hostChromeFailures.js"; import { plan } from "./plan.js"; import { renderChunk } from "./renderChunk.js"; -// Tiny composition shared by both subtests. 5 frames at 30fps lands a chunk -// within a few seconds inside Docker and keeps host runs (where this test -// soft-skips most of the time) cheap when they do exercise the full path. +// Tiny composition shared by every subtest. 5 frames at 30fps + chunkSize=2 +// lands three chunks of sizes [2, 2, 1] within a few seconds inside Docker +// and keeps host runs (where this test soft-skips most of the time) cheap +// when they do exercise the full path. We assert byte-identity on chunk 0 +// (the always-special first chunk) and chunk 1 (the smallest non-zero +// chunk index, exercising the seek-offset + frame-indexing code path that +// a regression specific to chunks N>0 would land in). const FIXTURE_HTML = `