Skip to content

Commit ec270f6

Browse files
authored
Update worker file (#18)
1 parent 789e013 commit ec270f6

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

javascript/dist/queue/Worker.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,23 @@ class Worker extends BaseRunner_1.BaseRunner {
6363
async populate(tests, seed) {
6464
if (this.config.retriedBuildId) {
6565
console.log(`[ci-queue] Retrying failed tests for build ${this.config.retriedBuildId}`);
66-
const failedTestGroups = await this.getFailedTestGroupsFromPreviousBuild();
67-
console.log(`[ci-queue] Failed test groups: ${failedTestGroups}`);
68-
await this.push(failedTestGroups);
69-
}
70-
else {
71-
if (seed !== undefined) {
72-
tests = (0, utils_1.shuffleArray)(tests, seed);
66+
try {
67+
const failedTestGroups = await this.getFailedTestGroupsFromPreviousBuild();
68+
console.log(`[ci-queue] Failed test groups: ${failedTestGroups}`);
69+
await this.push(failedTestGroups);
70+
return;
7371
}
74-
await this.push(tests);
72+
catch (e) {
73+
// If the previous build is still in-progress, getFailedTestGroupsFromPreviousBuild will fail
74+
// In this case, we want to continue processing the original tests
75+
console.error('[ci-queue] Failed to get failed test groups from previous build', e);
76+
console.log('[ci-queue] Continuing with original tests');
77+
}
78+
}
79+
if (seed !== undefined) {
80+
tests = (0, utils_1.shuffleArray)(tests, seed);
7581
}
82+
await this.push(tests);
7683
}
7784
shutdown() {
7885
this.shutdownRequired = true;

0 commit comments

Comments
 (0)