fix(producer): pass variables to duration probe

This commit is contained in:
Miguel Ángel
2026-07-13 13:23:57 +00:00
parent 758a6d2152
commit 103166098f
2 changed files with 19 additions and 1 deletions
@@ -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 () => ({
@@ -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;
}
@@ -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();
@@ -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,
};