fix(cli): cloud render sends one zip when it fits and uploads only the largest media (#7859)

* fix(cli): cloud render sends one zip when it fits and uploads only the largest media

* fix(cli): cloud render leaves unused media out only when the zip is over the limit

* test(cli): eight-at-once upload test waits for eight in flight, never a timer

* test(cli): eight-at-once upload test also fails when more than eight run
This commit is contained in:
Miguel Ángel
2026-11-15 21:19:22 +00:00
committed by GitHub
parent 52d43f33a3
commit 9bc2b231d3
8 changed files with 318 additions and 44 deletions
@@ -78,6 +78,21 @@ describe("runWithConcurrencyLimit", () => {
expect(out).toEqual([]);
});
it("after a rejection starts nothing new and settles only once started work has finished", async () => {
const started: number[] = [];
let slowDone = false;
const run = runWithConcurrencyLimit([1, 2, 3, 4], 2, async (n) => {
started.push(n);
if (n === 2) throw new Error("boom");
await new Promise((r) => setTimeout(r, 30));
slowDone = true;
return n;
});
await expect(run).rejects.toThrow(/boom/);
expect(started).toEqual([1, 2]);
expect(slowDone).toBe(true);
});
it("propagates the first worker rejection", async () => {
await expect(
runWithConcurrencyLimit([1, 2, 3], 2, async (n) => {