From db92f8ab592e92571f172e1ba5c9791e002366bb Mon Sep 17 00:00:00 2001 From: James Russo Date: Tue, 1 Sep 2026 14:01:00 -0400 Subject: [PATCH] test(engine): give the 150-track audio mix test a Windows-sized budget (#3587) The ENAMETOOLONG regression writes 150 real clip files and the mixer existence-checks each one: ~58ms on Linux, but past vitest's 5s default on the Windows lane. packages/engine sets no global testTimeout, so heavy tests here carry an explicit one. On timeout its abandoned async work kept calling the shared runFfmpegMock after afterEach cleared it, so the next test saw 5 calls instead of 3 and lost its queued once-implementations to the leak. mockReset stops an aborted test from handing leftovers to the next one. --- packages/engine/src/services/audioMixer.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/engine/src/services/audioMixer.test.ts b/packages/engine/src/services/audioMixer.test.ts index 9a1091e3e..e7b1fb5ac 100644 --- a/packages/engine/src/services/audioMixer.test.ts +++ b/packages/engine/src/services/audioMixer.test.ts @@ -107,7 +107,7 @@ describe("processCompositionAudio", () => { afterEach(() => { vi.unstubAllGlobals(); - runFfmpegMock.mockClear(); + runFfmpegMock.mockReset(); extractAudioMetadataMock.mockReset(); extractAudioMetadataMock.mockResolvedValue({ durationSeconds: 2, @@ -1098,7 +1098,9 @@ describe("processCompositionAudio", () => { // indefinite `apad` to cap the padded stream at composition duration. expect((filter?.match(/atrim=/g) ?? []).length).toBe(trackCount * 2); expect((filter?.match(/apad,/g) ?? []).length).toBe(trackCount); - }); + // 150 real files + 150 existence checks: ~60ms on Linux, but well past the 5s + // default on the Windows lane, where each file create is orders slower. + }, 30_000); it("renumbers timestamps between apad and atrim on every mixed branch", async () => { // Regression: `apad` then `atrim` is the portable pad-to-length shape --