willowtreeapps / conductor-mobile

Conductor Mobile is a port of the Conductor Web Framework for iOS and Android
Apache License 2.0
6 stars 5 forks source link

Improve driver cleanup with shutdown hook #161

Closed mrk-han closed 4 years ago

mrk-han commented 4 years ago

SauceLabs warned us that we may not be properly cleaning up our sessions. This PR will help us quit the driver even when receiving a SIGINT or another unexpected crash.

We're using java.lang.Runtime.addShutdownHook() to ensure Appium receives a quit message even if the process is interrupted.

Cleaning up our sessions will help idle concurrency which will remove some of the execution bottleneck.

One edge case that is unaccounted for is if we request a session and the test runner dies before it's created. In this case we will have to wait for the timeout to occur, which was reduced drastically from 10 minutes to 90 seconds.