Skip to content

Commit 0131c64

Browse files
committed
perf: download assets across runs in parallel
1 parent b9e8dbd commit 0131c64

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lib/test-results-downloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface TestResultArtifactStore {
3434
export class LruTestResultArtifactStore
3535
extends LruCache<string, AsyncValue<ParsedTestResultArtifact>> {
3636
constructor() {
37-
super(100);
37+
super(200);
3838
}
3939
}
4040

routes/insights.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,18 @@ export class InsightsPageController {
4343
.slice(0, 20);
4444

4545
// Download test results for all runs
46-
const allResults: Array<{
47-
runId: number;
48-
run: WorkflowRun;
49-
results: JobTestResults[];
50-
}> = [];
51-
52-
for (const run of mainBranchRuns) {
46+
const allResults = (await Promise.all(mainBranchRuns.map(async run => {
5347
try {
5448
const results = await this.#downloader.downloadForRunId(run.id);
55-
allResults.push({ runId: run.id, run, results });
49+
return { runId: run.id, run, results };
5650
} catch (error) {
5751
this.#logger.logError(
5852
`Failed to download results for run ${run.id}:`,
5953
error,
6054
);
55+
return undefined!;
6156
}
62-
}
57+
}))).filter(r => r != null);
6358

6459
// Analyze flaky tests across all runs
6560
const flakyTestsMap = new Map<

0 commit comments

Comments
 (0)