Merge pull request #19204 from github/oscarsj/migrate-builders-macos-15

Run pytest server with `sudo` and higher `nice` value
This commit is contained in:
Óscar San José
2025-04-02 16:59:11 +02:00
committed by GitHub

View File

@@ -1,11 +1,15 @@
import subprocess
import sys
import runs_on
def test(codeql, java):
# This serves the "repo" directory on http://localhost:9427
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
repo_server_process = subprocess.Popen(
[sys.executable, "-m", "http.server", "9427"], cwd="repo"
command, cwd="repo"
)
try:
codeql.database.create(