perf: streamline repository and deployment awareness
ForgeFlow quality gate / quality (push) Canceled after 0s

This commit is contained in:
NuklearRabbit
2026-08-12 15:26:53 +02:00
parent 38e221cbd1
commit 32ed4fcb5e
19 changed files with 351 additions and 73 deletions
+19
View File
@@ -172,3 +172,22 @@ test('rollback refuses a stale target that is no longer the server-reported prev
assert.equal(dispatched, false);
});
test('active deployment refreshes run concurrently with a bounded worker pool', async () => {
const operations = Array.from({ length: 9 }, (_, index) => ({ id: `operation-${index}`, type: 'deployment', status: 'running' }));
const service = new DeploymentService({ data: { operations } }, {}, {});
let running = 0;
let peak = 0;
service.refreshOperation = async (id) => {
running += 1;
peak = Math.max(peak, running);
await new Promise((resolve) => setTimeout(resolve, 10));
running -= 1;
return { id };
};
const refreshed = await service.refreshActiveOperations();
assert.equal(refreshed.length, operations.length);
assert.ok(peak > 1);
assert.ok(peak <= 4);
});