Skip to content

Run pytest server with sudo and higher nice value #19204

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

Merged
merged 3 commits into from
Apr 2, 2025

Conversation

oscarsj
Copy link
Contributor

@oscarsj oscarsj commented Apr 2, 2025

Run pytest server with sudo and higher nice value to avoid timeouts when running this test in macos-15 runners

@Copilot Copilot AI review requested due to automatic review settings April 2, 2025 14:11
@oscarsj oscarsj requested a review from a team as a code owner April 2, 2025 14:11
@github-actions github-actions bot added the Java label Apr 2, 2025
Copy link
Contributor

@Copilot 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 pull request updates the test server startup command to run with sudo and a higher nice value, aiming to avoid timeouts on macOS-15 runners.

  • Added a conditional check for GitHub Actions and POSIX environments.
  • Modified the command used to launch the test server.

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

command = ["python3", "-m", "http.server", "9427", "-b", "localhost"]
if runs_on.github_actions and runs_on.posix:
# On GitHub Actions, we try to run the server with higher priority
command = ["sudo", "nice", "-n", "10"] + command
Copy link
Preview

Copilot AI Apr 2, 2025

Choose a reason for hiding this comment

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

Using sudo in the test command may trigger a password prompt if the runner is not configured for passwordless sudo, potentially causing test hangs. Consider verifying or enforcing passwordless sudo configuration on the target runners.

Suggested change
command = ["sudo", "nice", "-n", "10"] + command
os.nice(10)

Copilot uses AI. Check for mistakes.

@oscarsj oscarsj merged commit f451551 into main Apr 2, 2025
12 checks passed
@oscarsj oscarsj deleted the oscarsj/migrate-builders-macos-15 branch April 2, 2025 14:59
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.

2 participants