Compare commits

...

2 Commits

Author SHA1 Message Date
Óscar San José
1ac3e80e96 Fix typo in test setting 2025-04-04 15:02:51 +02:00
Óscar San José
7da9eab3a4 Use sudo nice with more local testing servers, to avoid timeouts in macos-15 2025-04-04 14:24:57 +02:00
2 changed files with 20 additions and 3 deletions

View File

@@ -1,11 +1,23 @@
import subprocess
import logging
import runs_on
def test(codeql, java):
# Each of these serves the "repo" and "repo2" directories on http://localhost:924[89]
repo_server_process = subprocess.Popen(["python3", "-m", "http.server", "9428"], cwd="repo")
repo_server_process2 = subprocess.Popen(["python3", "-m", "http.server", "9429"], cwd="repo2")
command1 = ["python3", "-m", "http.server", "9428"]
command2 = ["python3", "-m", "http.server", "9429"]
if runs_on.github_actions and runs_on.posix:
# On GitHub Actions, we try to run the server with higher priority
sudo_prefix = ["sudo", "nice", "-n", "10"]
command1 = sudo_prefix + command1
command2 = sudo_prefix + command2
repo_server_process = subprocess.Popen(
command1, cwd="repo"
)
repo_server_process2 = subprocess.Popen(
command2, cwd="repo2"
)
try:
codeql.database.create(
extractor_option="buildless=true",

View File

@@ -1,10 +1,15 @@
import subprocess
import os
import runs_on
def test(codeql, java, cwd):
# 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:
# On GitHub Actions, we try to run the server with higher priority
command = ["sudo", "nice", "-n", "10"] + command
repo_server_process = subprocess.Popen(command, cwd="repo")
certspath = cwd / "jdk8_shipped_cacerts_plus_cert_pem"
# If we override MAVEN_OPTS, we'll break cross-test maven isolation, so we need to append to it instead
maven_opts = os.environ["MAVEN_OPTS"] + f" -Djavax.net.ssl.trustStore={certspath}"