MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / drainOne

Function drainOne

src/commands/test.ts:2762–2772  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.

Callers 1

runBatchRunFunction · 0.85

Calls 2

triggerOneFunction · 0.85
deleteMethod · 0.80

Tested by

no test coverage detected