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.
This commit is contained in:
James Russo
2026-09-01 14:01:00 -04:00
committed by GitHub
parent 6cbe3fbe90
commit db92f8ab59
@@ -107,7 +107,7 @@ describe("processCompositionAudio", () => {
afterEach(() => { afterEach(() => {
vi.unstubAllGlobals(); vi.unstubAllGlobals();
runFfmpegMock.mockClear(); runFfmpegMock.mockReset();
extractAudioMetadataMock.mockReset(); extractAudioMetadataMock.mockReset();
extractAudioMetadataMock.mockResolvedValue({ extractAudioMetadataMock.mockResolvedValue({
durationSeconds: 2, durationSeconds: 2,
@@ -1098,7 +1098,9 @@ describe("processCompositionAudio", () => {
// indefinite `apad` to cap the padded stream at composition duration. // indefinite `apad` to cap the padded stream at composition duration.
expect((filter?.match(/atrim=/g) ?? []).length).toBe(trackCount * 2); expect((filter?.match(/atrim=/g) ?? []).length).toBe(trackCount * 2);
expect((filter?.match(/apad,/g) ?? []).length).toBe(trackCount); 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 () => { it("renumbers timestamps between apad and atrim on every mixed branch", async () => {
// Regression: `apad` then `atrim` is the portable pad-to-length shape -- // Regression: `apad` then `atrim` is the portable pad-to-length shape --