Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion packages/producer/src/services/render/stages/probeStage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { hasAutoStartVideos, hasScriptedAudioVolumeAutomation } from "./probeSta
// the correct forceScreenshot value (regression for #1236 — probe was launched
// in beginframe mode even when lowMemoryMode demanded screenshot capture).
const capturedCfgs: unknown[] = [];
const capturedOptions: unknown[] = [];

const mockPage = {
evaluate: async () => ({
Expand Down Expand Up @@ -39,12 +40,13 @@ mock.module("@hyperframes/engine", () => ({
createCaptureSession: async (
_url: string,
_dir: string,
_opts: unknown,
opts: unknown,
_nullArg: unknown,
cfg: unknown,
) => {
createSessionCallCount++;
capturedCfgs.push(cfg);
capturedOptions.push(opts);
if (createSessionError && createSessionCallCount <= createSessionFailUntilAttempt) {
throw createSessionError;
}
Expand Down Expand Up @@ -279,6 +281,21 @@ describe("runProbeStage — forceScreenshot threading", () => {
});
});

describe("runProbeStage — render variable threading", () => {
it("passes render variables to the duration-discovery capture session", async () => {
capturedOptions.length = 0;
const { runProbeStage } = await import("./probeStage.js");
const input = makeProbeInput({ stageForceScreenshot: false });
input.job.config.variables = { short: true, sceneCount: 2 };

await runProbeStage(input);

expect(capturedOptions[0]).toMatchObject({
variables: { short: true, sceneCount: 2 },
});
});
});

describe("runProbeStage — transient browser error retry (#1687)", () => {
it("retries once on a transient 'Navigating frame was detached' error and succeeds", async () => {
resetRetryMocks();
Expand Down
1 change: 1 addition & 0 deletions packages/producer/src/services/render/stages/probeStage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export async function runProbeStage(input: ProbeStageInput): Promise<ProbeStageR
fps: job.config.fps,
format: needsAlpha ? "png" : "jpeg",
quality: needsAlpha ? undefined : 80,
variables: job.config.variables,
deviceScaleFactor,
};

Expand Down
Loading