Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add CLI argument for maxSessions #580

Merged

Conversation

JoelWhitney
Copy link
Contributor

@JoelWhitney JoelWhitney commented Dec 10, 2022

Description

As I've begun running more tests concurrently, I have started to see significant performance degradation with Appium where things will slow down and sessions will start to have subprocesses killed on host machine resulting in test failures. Adding this CLI argument to device-farm allows the user to limit the number of tests running at a time to make sure they are getting the bests performance based on the hardware that they are running tests on.

Selenium Grid also provides a --max-sessions CLI argument for limiting the number of sessions that can be run concurrently.

Note: I also added an Active session label in the web app, which was mainly a convenient way to test that the implementation was working -- I can remove this if you'd like

image

Usage

appium server -ka 800 --use-plugins=device-farm,appium-dashboard -pa /wd/hub --plugin-device-farm-platform=android --plugin-device-farm-max-sessions=8

TODO

  • Add tests for new CLI argument

@saikrishna321
Copy link
Member

@JoelWhitney Thanks for the PR.

If the max-session is set then should the clients handle to send only the same number of requests?

Let me give you an example

Consider TestNG as runner which will mark the thread-count as number of devices. So in this case should it mark as max-session count or device count?

@JoelWhitney
Copy link
Contributor Author

@saikrishna321 yes, if I understand correctly, I think it makes sense that clients would only send the same number of requests that are being set as max-sessions.

However, when multiple clients are targeting the device-farm simultaneously (say from CI), it’s difficult to limit requests from the individual clients. Having the max-sessions enforced on the server (device-farm) allows clients to run freely without overtaxing the host machine running the server with devices as it will build of queue of pending sessions.

Hopefully that addresses your question, if not let me know 😊

@saikrishna321
Copy link
Member

@JoelWhitney Got it! We might have to add this information in readMe section. Lets release this

@saikrishna321 saikrishna321 merged commit e296b47 into AppiumTestDistribution:main Dec 11, 2022
@github-actions
Copy link

🚀 [bumpr] Bumped! New version:v3.4.0 Changes:v3.3.0...v3.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants