mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user