Skip to content

Commit

Permalink
Do not kill emulators when testing (facebook#47030)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#47030

Looking at the videos from the E2E tests, it seems that the tests are pretty reliable aside from the first one that often fail. And it looks like it is failing not because the test is wrong, but because maestro hits some sort of timeout and kills the test sooner.

With these changes we are:
- giving more time to maestro to run
- not killing the emulator anymore

Killing and restarting the simulator was making this problem workse, because a newly started simulator required more time to boots and to work properly

## Changelog:
[Internal] - stop killing simulators and increase timeouts

Reviewed By: cortinico

Differential Revision: D64398111

fbshipit-source-id: 17b107fee24d0fbd4897212c1907be3761e337ab
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Oct 15, 2024
1 parent 8cf27e8 commit 40bcf0e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .github/actions/maestro-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,18 @@ runs:
if [[ ${{ inputs.flavor }} == 'Debug' ]]; then
# To give the app time to warm the metro's cache
sleep 5
sleep 20
fi
echo "Running tests with Maestro"
export MAESTRO_DRIVER_STARTUP_TIMEOUT=1200000 # 20 min. CI is extremely slow
export MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 # 25 min. CI is extremely slow
# Add retries for flakyness
MAX_ATTEMPTS=5
CURR_ATTEMPT=0
RESULT=1
while [[ $CURR_ATTEMPT -lt $MAX_ATTEMPTS ]] && [[ $RESULT -ne 0 ]]; do
if [[ $CURR_ATTEMPT -ne 0 ]]; then
echo "Rebooting simulator for stability"
xcrun simctl boot "iPhone 15 Pro"
fi
CURR_ATTEMPT=$((CURR_ATTEMPT+1))
echo "Attempt number $CURR_ATTEMPT"
Expand All @@ -103,9 +98,6 @@ runs:
# Stop video
kill -SIGINT $(cat video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid)
echo "Shutting down simulator for stability"
xcrun simctl shutdown "iPhone 15 Pro"
done
exit $RESULT
Expand Down

0 comments on commit 40bcf0e

Please sign in to comment.