Skip to content

Commit 53b722c

Browse files
ci: SwiftUI Crash Test Increase Timeouts (#5706)
Increase the timeout to 20 seconds to check if the app has crashed and if it's still running. Also add more log messages. Fixes GH-5705
1 parent 42a95d5 commit 53b722c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

TestSamples/SwiftUICrashTest/test-crash-and-relaunch.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ xcrun simctl spawn $DEVICE_ID defaults write $BUNDLE_ID $USER_DEFAULT_KEY -bool
137137
log "Launching app with expected crash."
138138
xcrun simctl launch $DEVICE_ID $BUNDLE_ID
139139

140-
# Check every 100ms for 5 seconds if the app is still running.
140+
log "Starting to check if app crashed as expected."
141+
142+
# Check for 20 seconds if the app is still running.
141143
start_time=$(date +%s)
142144
while true; do
143145
if is_app_running; then
@@ -150,10 +152,11 @@ while true; do
150152
current_time=$(date +%s)
151153
elapsed=$((current_time - start_time))
152154

153-
if [ $elapsed -ge 5 ]; then
154-
log "❌ App is still running after 5 seconds but it should have crashed instead."
155+
if [ $elapsed -ge 20 ]; then
156+
log "❌ App is still running after 20 seconds but it should have crashed instead."
155157
exit 1
156158
fi
159+
157160
done
158161

159162
take_simulator_screenshot "after-crash"
@@ -171,7 +174,9 @@ xcrun simctl launch $DEVICE_ID $BUNDLE_ID &
171174

172175
take_simulator_screenshot "after-crash-check"
173176

174-
# Check for 5 seconds if the app is running.
177+
log "Starting to check if app is running."
178+
179+
# Check for 20 seconds if the app is still running.
175180
start_time=$(date +%s)
176181
while true; do
177182
if is_app_running; then
@@ -183,7 +188,7 @@ while true; do
183188
current_time=$(date +%s)
184189
elapsed=$((current_time - start_time))
185190

186-
if [ $elapsed -ge 5 ]; then
191+
if [ $elapsed -ge 20 ]; then
187192
log "✅ Completed checking if app is still running."
188193
break
189194
fi

0 commit comments

Comments
 (0)