fix: isolate artifact rebuild from release suites
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
This commit is contained in:
+25
-1
@@ -72,6 +72,30 @@ export async function runWithConcurrency(items, concurrency, worker) {
|
||||
return results;
|
||||
}
|
||||
|
||||
// Some suites intentionally mutate the shared candidate artifact. Run those
|
||||
// suites before the parallel batch so they cannot race suites that boot the
|
||||
// same runtime while it is being rebuilt.
|
||||
export async function runSuitesWithConcurrency(items, concurrency, worker) {
|
||||
const results = new Array(items.length);
|
||||
const parallel = [];
|
||||
for (let index = 0; index < items.length; index += 1) {
|
||||
if (items[index].exclusive) {
|
||||
results[index] = await worker(items[index], index);
|
||||
} else {
|
||||
parallel.push({ item: items[index], index });
|
||||
}
|
||||
}
|
||||
const parallelResults = await runWithConcurrency(
|
||||
parallel,
|
||||
concurrency,
|
||||
({ item, index }) => worker(item, index),
|
||||
);
|
||||
for (let index = 0; index < parallel.length; index += 1) {
|
||||
results[parallel[index].index] = parallelResults[index];
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
export async function runCommand(command, args, {
|
||||
cwd = ROOT,
|
||||
timeoutMs = 15 * 60 * 1000,
|
||||
@@ -220,7 +244,7 @@ export async function executeReleaseGate(options) {
|
||||
);
|
||||
|
||||
const suites = AUTOMATION_SUITES.filter((candidate) => suiteIsInMode(candidate, options.mode));
|
||||
const executions = await runWithConcurrency(
|
||||
const executions = await runSuitesWithConcurrency(
|
||||
suites,
|
||||
options.suiteConcurrency,
|
||||
(suite) => runSuite(suite, outputDir, options.timeoutMs),
|
||||
|
||||
Reference in New Issue
Block a user