AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
329 stars 103 forks source link

Devices do not run tests due to device busy #1416

Open CharlanSofist opened 1 week ago

CharlanSofist commented 1 week ago

Describe the bug

I have a test battery to run and I have several devices with different configurations in the farm, they all appear in the farm, but when I go to run the slowest ones they take a long time to generate the build in the builds tab and the fastest ones are already running, but when the fastest ones reach the end they wait for the queue to clear so they can run the next test, so they stop, this only happens when I have many devices connected, test with only 2 devices and this does not happen, when I am running with 13 devices this happens.

In this case, the slowest device times out and only after that do the other devices start running the tests. In my code, I run the tests individually so it is parallel for each device. Below is how I am starting the server and the capabilities that I am sending.

appium server -ka 800 --local-timezone --use-plugins=device-farm --plugin-device-farm-platform=both --plugin-device-farm-booted-simulators --plugin-device-farm-max-sessions=32 --allow-insecure adb_shell --plugin-device-farm-live-streaming

capabilities: UiAutomator2Options options = new UiAutomator2Options(); options.setDeviceName(deviceName) .setPlatformVersion(platformVersion) .setPlatformName(platformName) .setUdid(udid) .autoGrantPermissions() .setApp(appPathRelative) .setAutomationName("UiAutomator2"); options.setCapability("logLevel", "debug"); options.setCapability("df:liveVideo", true); options.setCapability("df:recordVideo", true); options.setCapability("df:saveDeviceLogs", true); options.setCapability("df:build", deviceName);

Link to Appium logs https://gist.github.com/CharlanSofist/d81b638c9fdc2277b0500cea6d73f95e

JAVA LOGS In this log its display de device don't open a session and all devices wait for it. https://gist.github.com/CharlanSofist/a15b28c1f6cee287d4009fc087f0ab29

Environment

Appium version (or git revision) that exhibits the issue: 2.11.3, device-farm@9.4.1 [installed (npm)] Last Appium version that did not exhibit the issue (if applicable): Node.js version (unless using Appium.app|exe): 22.8.0 Npm or Yarn package manager: 10.8.2 Mobile platform/version under test: IOS Real device or emulator/simulator: simulator Appium CLI or Appium.app|exe: N?A

Jitu1888 commented 9 hours ago

@saikrishna321 How we can clean up sessions present in queue ? Because when I m running multiple scripts in parallel, somehow for some reason session are getting into queue list and after that session null pointer is coming.

saikrishna321 commented 4 hours ago

@Jitu1888 Currently, we don't have this feature.

when I m running multiple scripts in parallel, somehow for some reason session are getting into queue lis This will happening when all the devices are busy and a request for create a session has reached the plugin.

CharlanSofist commented 2 hours ago

Hi @saikrishna321, Can this be queued for development?