Skip to content

Commit 7aac144

Browse files
chore: fix tests
1 parent 98d02c3 commit 7aac144

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

maestro/helpers/helpers.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,24 @@ stop_recording() {
7979
REC_FILE=""
8080
}
8181

82+
# Function to clean up stale XCTest processes (iOS only)
83+
cleanup_xctest_processes() {
84+
if [ "$PLATFORM" != "ios" ]; then
85+
return 0
86+
fi
87+
echo "🧹 Cleaning up stale XCTest processes..."
88+
# Kill any leftover XCTest runner processes that might be blocking driver initialization
89+
pkill -9 -f "XCTRunner" 2>/dev/null || true
90+
pkill -9 -f "xctest" 2>/dev/null || true
91+
pkill -9 -f "maestro.*driver" 2>/dev/null || true
92+
sleep 2
93+
}
94+
8295
# Function to restart the iOS simulator
8396
restart_simulator() {
8497
echo "🔄 Restarting iOS Simulator..."
98+
# Clean up XCTest processes first
99+
cleanup_xctest_processes
85100
# Shut down whatever is booted; the device is auto-selected in prepare_ios.sh,
86101
# so we don't depend on a hardcoded device name here.
87102
xcrun simctl shutdown all || true

maestro/run_maestro_jsactions_tests.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ run_jsactions_tests() {
9797
fi
9898
}
9999

100+
# Clean up any stale XCTest processes before starting (iOS only)
101+
if [ "$PLATFORM" == "ios" ]; then
102+
cleanup_xctest_processes
103+
fi
104+
105+
# Fast-fail smoke check before running jsActions tests (same as widget tests)
106+
if ! smoke_check; then
107+
exit 1
108+
fi
109+
100110
# Run jsActions tests
101111
run_jsactions_tests
102112
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)