AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Apache License 2.0
295 stars 90 forks source link

The server floods with an error and leaves the phone busy forever #961

Closed Comeodore closed 5 months ago

Comeodore commented 6 months ago

Device farm 8.4.6 https://gist.github.com/Comeodore/546c7db91e7d948aa54ab060e757042e

Session didnt drop, no session in url/device-farm/api/devices on device with udid emulator-5554, and in web this devices is "busy" but didnt have session id below In logs of node this 'busy' device is also present

image Reproduced on normal test runs quite often, because of this, the test can simply freeze dead when the session with the driver is running

UPD. after 10-15 minutes device still busy

@saikrishna321

saikrishna321 commented 6 months ago

@Comeodore Emulator 5554 has a session created and its busy, i don't see any delete session call for the device to be unblocked.

NewCommandTimeout is 600seconds and that is the reason why the device remains busy thinking that appium might send a command.

Logic: if newCommandTimeout exceeds appium by default will send a delete session call and device-farm will unblocked the device.

Let me check if appium sends the delete call when newCommandTimeout is expired.

Comeodore commented 6 months ago

i don't see any delete session call for the device to be unblocked

@saikrishna321 I specially add request for force delete session when driver is stopped, but i tryied get session id from device-farm and this is empty, like on my screenshot, can we do smth with that?

saikrishna321 commented 6 months ago

i don't see any delete session call for the device to be unblocked

@saikrishna321 I specially add request for force delete session when driver is stopped, but i tryied get session id from device-farm and this is empty, like on my screenshot, can we do smth with that?

Sorry I quite don't get your ask.

Comeodore commented 6 months ago

Sorry I quite don't get your ask.

@saikrishna321 Since sometimes there are problems with completing a session in the appium, to be on the safe side, I always send a request to appium server that the session is completed via requests (request.delete to appium server with session id), but I pull the session id from device-farm, which like, as we see in the screenshot - losted somewhere

telegram-cloud-photo-size-2-5276182704423032775-m

My question is, can we do something about the fact that the device is locked and there is no session ID?

Comeodore commented 6 months ago

@saikrishna321 I will try to reproduce this with full logs from hub and node and give it to you, because my tests 100% send driver.quit to appium server

saikrishna321 commented 6 months ago

@Comeodore Is this happening when session failed to created??

Comeodore commented 6 months ago

Is this happening when session failed to created??

@saikrishna321 yep

saikrishna321 commented 6 months ago

Please try with latest RC and see if this happens

Comeodore commented 6 months ago

Please try with latest RC and see if this happens

Ok, i will try

saikrishna321 commented 5 months ago

Fixed.