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

Mostieri/parallel runs avoid clash #384

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

mariostieriansys
Copy link
Collaborator

In my attempt to run PyEnSight tests in parallel during the ADO builds, I am having several issues on linux where port clashes happen between the different PyEnSight sessions.

There are two clashes happening. I am not sure which of the two, but surely one of these:

  1. EnSight is launched without the "-ports" argument with a newly found random port. I believe EnSight internally should try to do the Client/Server connection with ports between 1104 to 1119, but potentially that's an issue
  2. This is the most likely. The find_unused_port code in multiple simultaneous runs may find the same free ports before these are being used for an actual connection, like the gRPC connection or the VNC connection

To avoid these issues, I have introduced an internal function which inspects the current processes and their command lines, so to build a list of ports to avoid to be fed into find_unused_ports.
Also, I am looking for an additional free port so to be used in the EnSight launch with "-ports" for the client/server connection. Finally, instead of using the pid of the process as starting point, I am using the random module. This workflow is being used only by the locallauncher

I have built the wheel and used it on one of the linux agents, the tests run correctly in parallel

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.

Project coverage is 96.32%. Comparing base (7071ba6) to head (75cd7f7).
Report is 5 commits behind head on main.

Files Patch % Lines
src/ansys/pyensight/core/launcher.py 82.75% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #384      +/-   ##
==========================================
+ Coverage   93.86%   96.32%   +2.46%     
==========================================
  Files          18       17       -1     
  Lines        2690     2615      -75     
  Branches      321      319       -2     
==========================================
- Hits         2525     2519       -6     
+ Misses        124       52      -72     
- Partials       41       44       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/ansys/pyensight/core/launcher.py Show resolved Hide resolved
src/ansys/pyensight/core/locallauncher.py Outdated Show resolved Hide resolved
@mariostieriansys mariostieriansys merged commit 4503f61 into main Jul 5, 2024
25 checks passed
@mariostieriansys mariostieriansys deleted the mostieri/parallel_runs_avoid_clash branch July 5, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants