File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -94,15 +94,23 @@ export class Worker extends BaseRunner {
9494 async populate ( tests : string [ ] , seed ?: number ) {
9595 if ( this . config . retriedBuildId ) {
9696 console . log ( `[ci-queue] Retrying failed tests for build ${ this . config . retriedBuildId } ` ) ;
97- const failedTestGroups = await this . getFailedTestGroupsFromPreviousBuild ( ) ;
98- console . log ( `[ci-queue] Failed test groups: ${ failedTestGroups } ` ) ;
99- await this . push ( failedTestGroups ) ;
100- } else {
101- if ( seed !== undefined ) {
102- tests = shuffleArray ( tests , seed ) ;
97+ try {
98+ const failedTestGroups = await this . getFailedTestGroupsFromPreviousBuild ( ) ;
99+ console . log ( `[ci-queue] Failed test groups: ${ failedTestGroups } ` ) ;
100+ await this . push ( failedTestGroups ) ;
101+ return ;
102+ } catch ( e ) {
103+ // If the previous build is still in-progress, getFailedTestGroupsFromPreviousBuild will fail
104+ // In this case, we want to continue processing the original tests
105+ console . error ( '[ci-queue] Failed to get failed test groups from previous build' , e ) ;
106+ console . log ( '[ci-queue] Continuing with original tests' ) ;
103107 }
104- await this . push ( tests ) ;
105- }
108+ }
109+
110+ if ( seed !== undefined ) {
111+ tests = shuffleArray ( tests , seed ) ;
112+ }
113+ await this . push ( tests ) ;
106114 }
107115
108116 shutdown ( ) {
You can’t perform that action at this time.
0 commit comments