@@ -121,6 +121,7 @@ - (void)retry {
121
121
if (![self canRetryOnError ] || self.failureTolerance <= 0 ) {
122
122
// If there is no more retries, set the final exitCode to current context's exitCode
123
123
self.finalExitStatus |= self.context .finalExitStatus ;
124
+ [BPUtils printInfo: ERROR withString: @" No retries left. Giving up." ];
124
125
[BPUtils printInfo: INFO withString: @" %s :%d finalExitStatus = %@ " , __FILE__, __LINE__, [BPExitStatusHelper stringFromExitStatus: self .finalExitStatus]];
125
126
self.exitLoop = YES ;
126
127
return ;
@@ -158,9 +159,9 @@ - (void)recover {
158
159
// If error retry reach to the max, then return
159
160
if (![self canRetryOnError ]) {
160
161
self.finalExitStatus |= self.context .finalExitStatus ;
162
+ [BPUtils printInfo: ERROR withString: @" No retries left. Giving up." ];
161
163
[BPUtils printInfo: INFO withString: @" %s :%d finalExitStatus = %@ " , __FILE__, __LINE__, [BPExitStatusHelper stringFromExitStatus: self .finalExitStatus]];
162
164
self.exitLoop = YES ;
163
- [BPUtils printInfo: ERROR withString: @" Too many retries have occurred. Giving up." ];
164
165
return ;
165
166
}
166
167
@@ -186,9 +187,9 @@ - (void)recover {
186
187
- (void )proceed {
187
188
if (![self canRetryOnError ]) {
188
189
self.finalExitStatus |= self.context .finalExitStatus ;
190
+ [BPUtils printInfo: ERROR withString: @" No retries left. Giving up." ];
189
191
[BPUtils printInfo: INFO withString: @" %s :%d finalExitStatus = %@ " , __FILE__, __LINE__, [BPExitStatusHelper stringFromExitStatus: self .finalExitStatus]];
190
192
self.exitLoop = YES ;
191
- [BPUtils printInfo: ERROR withString: @" Too many retries have occurred. Giving up." ];
192
193
return ;
193
194
}
194
195
self.retries += 1 ;
@@ -591,7 +592,9 @@ - (void)deleteSimulatorOnlyTaskWithContext:(BPExecutionContext *)context {
591
592
*/
592
593
- (void )finishWithContext : (BPExecutionContext *)context {
593
594
context.finalExitStatus |= context.exitStatus ;
594
- [BPUtils printInfo: INFO withString: @" Attempt's Exit Status: %@ " , [BPExitStatusHelper stringFromExitStatus: context.exitStatus]];
595
+ [BPUtils printInfo: INFO withString: @" Attempt's Exit Status: %@ , Bundle exit status: %@ " ,
596
+ [BPExitStatusHelper stringFromExitStatus: context.exitStatus],
597
+ [BPExitStatusHelper stringFromExitStatus: context.finalExitStatus]];
595
598
596
599
switch (context.exitStatus ) {
597
600
// BP exit handler
@@ -628,19 +631,24 @@ - (void)finishWithContext:(BPExecutionContext *)context {
628
631
return ;
629
632
630
633
case BPExitStatusAppCrashed:
631
- // Remember the app crash and report whether a retry passes or not
634
+ // Crashed test is considered fatal and shall not be retried
632
635
self.finalExitStatus |= context.exitStatus ;
633
636
NEXT ([self proceed ]);
634
637
return ;
635
638
636
639
case BPExitStatusSimulatorDeleted:
637
640
case BPExitStatusSimulatorReuseFailed:
638
641
self.finalExitStatus |= context.finalExitStatus ;
639
- [BPUtils printInfo: INFO withString: @" %s :%d finalExitStatus = %@ " , __FILE__, __LINE__, [BPExitStatusHelper stringFromExitStatus: self .finalExitStatus]];
642
+ [BPUtils printInfo: INFO withString: @" %s :%d finalExitStatus = %@ " ,
643
+ __FILE__, __LINE__,
644
+ [BPExitStatusHelper stringFromExitStatus: self .finalExitStatus]];
640
645
self.exitLoop = YES ;
641
646
return ;
642
647
}
643
- [BPUtils printInfo: ERROR withString: @" %s :%d YOU SHOULDN'T BE HERE. exitStatus = %@ , finalExitStatus = %@ " , __FILE__, __LINE__, [BPExitStatusHelper stringFromExitStatus: context.exitStatus], [BPExitStatusHelper stringFromExitStatus: context.finalExitStatus]];
648
+ [BPUtils printInfo: ERROR withString: @" %s :%d YOU SHOULDN'T BE HERE. exitStatus = %@ , finalExitStatus = %@ " ,
649
+ __FILE__, __LINE__,
650
+ [BPExitStatusHelper stringFromExitStatus: context.exitStatus],
651
+ [BPExitStatusHelper stringFromExitStatus: context.finalExitStatus]];
644
652
}
645
653
646
654
// MARK: Helpers
@@ -666,7 +674,9 @@ - (BOOL)canRetryOnError {
666
674
if (self.retries > maxErrorRetryCount) {
667
675
// If retries strictly exceeds the max error retry, then we must have incremented it beyond the limit somehow.
668
676
// It is safe to halt retries here, but log to alert unexpected behavior.
669
- [BPUtils printInfo: ERROR withString: @" Current retry count (%d ) exceeded maximum retry count (%d )!" , (int ) self .retries, (int ) maxErrorRetryCount];
677
+ [BPUtils printInfo: ERROR withString: @" Current retry count (%d ) exceeded maximum retry count (%d )!" ,
678
+ (int ) self .retries,
679
+ (int ) maxErrorRetryCount];
670
680
}
671
681
return false ;
672
682
}
0 commit comments