Search code examples
pythoniosappiumnodes

Failed to stop node process if Appium fails with SessionNotCreated exception using Python


I'm running automation test for 10 iOS devices for Safari browser in parallel but during the test I noticed that randomly Appium fails with exception

SessionNotCreated

When such exception happens then the Appium connection fails but it fails to kill the process (Appium process is started by node) This cause a lot of memory usage for the device.

Any suggestions to handle such conditions?

Thanks in advance

  1. Tried to rerun appium whenever there is an exception
  2. Killing the process id for the Port where appium was running but it results in killing the whole script
  3. Added random waits to avoid 10 parallel tests starting at the same time

Solution

  • Fixed using os.kill from python