Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Feb 15, 2018 15:39

By Eynav Cohen


Perfecto has received several support cases from customers that describe an issue with Appium script executions on XCUItest enabled devices that crash in the midst of a long execution.

Our investigation of the issue highlighted two major causes for the crash:

  1. Memory leak in the Appium's IosDriver’s device-side component.

The leak is affected by execution time per driver session – meaning between the creation and closing (driver.close()) the driver instance. The longer the session lasts, the more memory consumed by the Appium driver instance running on the iOS device.

This is a documented issue in the Appium framework infrastructure. For example, as you can see there is open issue in the WebDriverAgent git hub project :


2. Stability degradation of iOS daemons involved with XCUITest executions that results with the script execution failure.
This behavior happens mainly after long executions, stress testing, heavy test operations, running test on very loaded view, tests that make intense use of several daemons in parallel (for example network stress along with querying vitals and running objects operations).

As part of a Perfecto's comprehensive solution most issues causing daemons stability degradation are handled to maintain device stability and to avoid crashes.

However, the remaining cause for crashes - that cannot be handled on the Perfecto side alone – is the execution time; The longer the driver session lasts, the more stability degradation will be suffered by Apple daemons.

Recommended Best Practice

Based on the above conclusions, to completely avoid iOS daemon and Appium driver related failures during execution, we recommend that customers split their test executions into shorter driver sessions.

  • For customers using only iPad Pro or iPhone 7 or newer devices driver sessions should not exceed 2 hours
  • For customers running tests also on older devices, driver sessions should not exceed 1 hour.

The term driver session refers to the time period from the point of IosDriver creation until the point in which driver is closed.

In case you require assistance in rearranging your scripts per the above, our Professional Services team will be happy to assist. Please contact Perfecto Support for more information.