@@ -151,7 +151,10 @@ function report_infrastructure_failure() {
151151 echo " Infrastructural problem reported by the user, requesting retry+reboot: $1 "
152152
153153 echo " $1 " > " $HELIX_WORKITEM_ROOT /.retry"
154- echo " $1 " > " $HELIX_WORKITEM_ROOT /.reboot"
154+
155+ if [[ " $2 " -ne " --no-reboot" ]]; then
156+ echo " $1 " > " $HELIX_WORKITEM_ROOT /.reboot"
157+ fi
155158}
156159
157160# Used to grep sys logs later in case of crashes
186189# it is probably an issue because Xcode should always have at least one runtime version inside
187190# 81 - simulator/device not found
188191if [ $exit_code -eq 81 ] && [[ " $target " =~ " simulator" ]] && [[ ! " $target " =~ " _" ]]; then
189- report_infrastructure_failure " No simulator runtime found"
192+ report_infrastructure_failure " No simulator runtime found" --no-reboot
190193fi
191194
192195# If we fail to find a real device, it is unexpected as device queues should have one
@@ -203,6 +206,19 @@ if [ $exit_code -eq 86 ]; then
203206 report_infrastructure_failure " Installation timed out"
204207fi
205208
209+ # Simulators are known to slow/break down and a reboot usually helps
210+ # This manifest by us not being able to launch the simulator
211+ # 88 - simulator failure
212+ if [ $exit_code -eq 88 ]; then
213+ report_infrastructure_failure " Failed to launch simulator"
214+ fi
215+
216+ # Devices can be locked or in a corrupted state, in this case we only retry the work item
217+ # 89 - device failure
218+ if [ $exit_code -eq 89 ]; then
219+ report_infrastructure_failure " Problem with the mobile device" --no-reboot
220+ fi
221+
206222# The simulator logs comming from the sudo-spawned Simulator.app are not readable/deletable by the helix uploader
207223sudo chown -R helix-runner " $output_directory "
208224chmod -R 0766 " $output_directory "
0 commit comments