Adb returning "undefined"

Appium is returning “undefined” after 5-6 Test cases executed in a suite of 35 Test cases. Sometimes after a time span of 20-30 minutes the suite restarts from the same line the error was faced, while sometimes the suite doesn’t restarts and suite has to be stopped manually.

Environment:
Appium - 1.4
Android devices with android version 6.0
Test machine - Windows 8
Java Version - 1.7.2

Appium Logs:

e[36minfoe[39m: JSONWP Proxy: Got response with status 200: {“sessionId”:“cb60c8eaa98152999d765e6e98ef610b”,“status”:0,“value”:{“ELEMENT”:“0.21494324225207895-182”}}
e[36minfoe[39m: JSONWP Proxy: Replacing sessionId cb60c8eaa98152999d765e6e98ef610b with 2682ad01-cf9a-46a1-a180-37a1e1ae367c
e[36minfoe[39m: e[37m<-- POST /wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/element e[39me[32m200e[39me[90m 150.119 ms - 109e[39m e[90me[39m
e[36minfoe[39m: e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/element/0.21494324225207895-182/displayede[39m e[90m{}e[39m
e[36minfoe[39m: JSONWP Proxy: Proxying [GET /wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/element/0.21494324225207895-182/displayed] to [GET http://127.0.0.1:9515/wd/hub/session/cb60c8eaa98152999d765e6e98ef610b/element/0.21494324225207895-182/displayed] with body: {}
e[36minfoe[39m: JSONWP Proxy: Got response with status 200: {“sessionId”:“cb60c8eaa98152999d765e6e98ef610b”,“status”:0,“value”:true}
e[36minfoe[39m: JSONWP Proxy: Replacing sessionId cb60c8eaa98152999d765e6e98ef610b with 2682ad01-cf9a-46a1-a180-37a1e1ae367c
e[36minfoe[39m: e[37m<-- GET /wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/element/0.21494324225207895-182/displayed e[39me[32m200e[39me[90m 44.176 ms - 76e[39m e[90me[39m
e[36minfoe[39m: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/contexte[39m e[90m{“name”:“NATIVE_APP”}e[39m
e[36minfoe[39m: [debug] Getting a list of available webviews
e[36minfoe[39m: [debug] executing cmd: C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s 1115fb7150b33003 shell “cat /proc/net/unix”
e[36minfoe[39m: e[37m<-- POST /wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/context e[39me[32m-e[39me[90m - ms - -e[39m e[90me[39m
e[36minfoe[39m: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/contexte[39m e[90m{“name”:“NATIVE_APP”}e[39m
e[36minfoe[39m: [debug] Getting a list of available webviews
e[36minfoe[39m: [debug] executing cmd: C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s 1115fb7150b33003 shell “cat /proc/net/unix”
undefined
e[36minfoe[39m: e[37m<-- POST /wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/context e[39me[32m-e[39me[90m - ms - -e[39m e[90me[39m
e[36minfoe[39m: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/2682ad01-cf9a-46a1-a180-37a1e1ae367c/contexte[39m e[90m{“name”:“NATIVE_APP”}e[39m
e[36minfoe[39m: [debug] Getting a list of available webviews
e[36minfoe[39m: [debug] executing cmd: C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s 1115fb7150b33003 shell “cat /proc/net/unix”

@Khemraj_choudhary did you try with “ERROR” log level?

I didn’t tried it, I will try and share the results but please let me know what difference will it make??

@Khemraj_choudhary i remember before it was problems when long tests are running and debug level set. I always use ERROR for suites. And change to debug only if i need locally for some test problem debugging.

You can try increasing the newCommandTimeout capability in case Appium is dropping the connection. I’ve noticed some test devices can’t maintain a long connection. In such cases, I remove that device from my testing pool.

I tried with ERROR log level, but I faced the same problem again, the execution become idle after some time (1 hour approx.) and no exception/error can be seen in the logs. It just sits idle.

I am using 2500 in newCommandTimeout capability, do you still feel I must increase it??
Because in some cases, after sitting idle the execution restarts automatically from the point where it got idle.

That timeout seems more than sufficient.