While running several test cases some of them suddenly fails with error creating session


#1

Hello!
I’m creating autotests to android, using android emulator 8.1.0. I have several features (using cucumber),

  • java 1.8
  • appium 1.11.1
  • java-client 6.1.0

(and no matter what appium I use, tryied downgrading to down to 1.8). When I start scope of tests (several features named high level scenarios with several test cases in each of it) I suddenly get the error creating session.
It can occure in first test and then several of next test could fail with this error (cannot create session) or not. Rest tests run successful. I pointed that this error occures in most cases on ubuntu server 16.04 with -no-screen on emulator.
On the real android device this problem does not occure. I delete session in the @After hooks from cucumber, and load appium server with nodejs.
Here are the error:
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘/home/android/android/platform-tools/adb -P 5037 -s emulator-5554 shell pm clear com...test’ timed out after 100000ms’. Try to increase the 100000ms adb execution timeout represented by ‘adbExecTimeout’ capability
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘android’, ip: ‘’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.15.0-45-generic’, java.version: ‘1.8.0_201’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘/home/android/android/platform-tools/adb -P 5037 -s emulator-5554 shell pm clear com...test’ timed out after 100000ms’. Try to increase the 100000ms adb execution timeout represented by ‘adbExecTimeout’ capability
at getResponseForW3CError (/home/android/nodejs/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/home/android/nodejs/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘android’, ip:’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.15.0-45-generic’, java.version: ‘1.8.0_201’
Driver info: driver.version: AndroidDriver


#2

It might be that adb simply freezes on this machine. Make sure the Android SDK is up to date and check the logcat output - perhaps you could find some explanation there