Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Recently we By Eynav Cohen

Background

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

We have investigated an issue and found Our investigation of the issue highlighted two major causes for the issuecrash:

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

The leak is affected by execution time per driver session – meaning between the opening creation and the closing of a certain driver (driver.close()) the driver instance. The longer the session lasts, the more memory will be consumed by the Appium driver component 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, test tests that make highly usage 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 of the issues causing daemons stability degradation are handled to maintain device stability and to avoid crashes.

The 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, we would like to recommend on best practice when running Appium scripts with XCUITest framework.

 

in order to completely avoid iOS daemons daemon and Appium driver related failures during execution, we advise recommend that customers  to 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 driver IosDriver creation until the point in which driver is closed.

 

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