()
| 2760 | const inFlight = new Set<Promise<CliBatchRunResult>>(); |
| 2761 | |
| 2762 | async function drainOne(): Promise<void> { |
| 2763 | const testId = remaining.shift(); |
| 2764 | if (testId === undefined) return; |
| 2765 | const p = triggerOne(testId).then(result => { |
| 2766 | batchRunResults.push(result); |
| 2767 | inFlight.delete(p); |
| 2768 | return result; |
| 2769 | }); |
| 2770 | inFlight.add(p); |
| 2771 | await p; |
| 2772 | } |
| 2773 | |
| 2774 | // Fill up to concurrencyLimit slots, then drain one before adding |
| 2775 | // each new testId so we never exceed the limit. |
no test coverage detected