Skip to content

Run test servers with sudo when running on macos-15#19252

Merged
oscarsj merged 5 commits intomainfrom
oscarsj/nice-servers-for-java-tests
Apr 8, 2025
Merged

Run test servers with sudo when running on macos-15#19252
oscarsj merged 5 commits intomainfrom
oscarsj/nice-servers-for-java-tests

Conversation

@oscarsj
Copy link
Copy Markdown
Member

@oscarsj oscarsj commented Apr 8, 2025

macos-15 has issues with test maven servers, that causes timeouts. Running those servers with sudo fixes the problem.
Same fix that #19204

@github-actions github-actions Bot added the Java label Apr 8, 2025
@oscarsj oscarsj changed the title use sudo nice for running maven test server Run test servers with sudo nice when running on macos-15 Apr 8, 2025
@oscarsj oscarsj marked this pull request as ready for review April 8, 2025 13:12
Copilot AI review requested due to automatic review settings April 8, 2025 13:12
@oscarsj oscarsj requested a review from a team as a code owner April 8, 2025 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses test server timeouts on macos-15 by running the server process with elevated priority via “sudo nice”.

  • Update the server process command to prepend “sudo nice -n 10” when a GitHub Actions environment on a posix system is detected.
  • Introduce an import for the new environment helper module "runs_on" to determine the execution context.

# This serves the "repo" directory on https://locahost:4443
repo_server_process = subprocess.Popen(["python3", "../server.py"], cwd="repo")
command = ["python3", "../server.py"]
if runs_on.github_actions and runs_on.posix:
Copy link

Copilot AI Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition does not strictly check for the 'macos-15' environment as referenced in the PR title. Consider updating the condition to explicitly target macos-15 to avoid potential unintended side-effects on other POSIX environments.

Suggested change
if runs_on.github_actions and runs_on.posix:
if runs_on.github_actions and runs_on.posix and runs_on.macos_version == "15":

Copilot uses AI. Check for mistakes.
Comment thread java/ql/integration-tests/java/buildless-inherit-trust-store/test.py Outdated
@oscarsj oscarsj requested a review from redsun82 April 8, 2025 14:20
@oscarsj oscarsj changed the title Run test servers with sudo nice when running on macos-15 Run test servers with sudo when running on macos-15 Apr 8, 2025
redsun82
redsun82 previously approved these changes Apr 8, 2025
Copy link
Copy Markdown
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment related suggestions, LGTM! Thanks for taking the time to test this out!

Can you update the PR title and description to reflect the change?

Comment thread java/ql/integration-tests/java/buildless-snapshot-repository/test.py Outdated
Comment thread java/ql/integration-tests/java/buildless-inherit-trust-store/test.py Outdated
…est.py

Co-authored-by: Paolo Tranquilli <redsun82@github.com>
…est.py

Co-authored-by: Paolo Tranquilli <redsun82@github.com>
@oscarsj oscarsj requested a review from redsun82 April 8, 2025 14:29
Copy link
Copy Markdown
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oscarsj oscarsj merged commit 6d95950 into main Apr 8, 2025
8 checks passed
@oscarsj oscarsj deleted the oscarsj/nice-servers-for-java-tests branch April 8, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants