diff --git a/.github/actions/install-apt-deps/action.yml b/.github/actions/install-apt-deps/action.yml index ab42960bab6..b5f1ec8bd19 100644 --- a/.github/actions/install-apt-deps/action.yml +++ b/.github/actions/install-apt-deps/action.yml @@ -16,7 +16,7 @@ inputs: the retry delays plus up to 20s of SIGKILL grace per attempt, and the per-command floors make values below retries*80 inert. This, plus pull-timeout, plus any ccache-setup in the same job, has to fit the - caller's timeout-minutes - the defaults need ~16 minutes. + caller's timeout-minutes; check-workflows.py checks it. required: false default: '600' pull-timeout: @@ -24,7 +24,7 @@ inputs: Deadline for the ghcr bundle pull. Counts against the same timeout-minutes as budget-seconds. required: false - default: '300' + default: '120' retry-delay: description: 'Initial delay between retries (seconds, doubles each attempt)' required: false diff --git a/.github/scripts/check-ci-deps.py b/.github/scripts/check-ci-deps.py index 8d1e02c1182..c9035e98edd 100755 --- a/.github/scripts/check-ci-deps.py +++ b/.github/scripts/check-ci-deps.py @@ -210,6 +210,24 @@ def check_call(self, where: str, tag: str, packages: str, f"{tag}.txt (or point this call at a bundle " f"that has it).") + def check_runners(self, where: str, label: str, pairs: list, + called: set) -> None: + """Check each runner of the job against the tag it runs with.""" + for runner, tag in dict.fromkeys(pairs): + if (runner, tag) not in called and series(runner) \ + and series(tag) and series(runner) != series(tag): + self.error(where, f"{label}: runs-on '{runner}' does not " + f"match ghcr-debs-tag '{tag}': the " + f"bundle holds .debs for {series(tag)}") + for runner, tag in dict.fromkeys(pairs): + if runner.startswith("ubuntu-latest") and series(tag): + self.error(where, f"{label}: runs-on '{runner}' with " + f"ghcr-debs-tag '{tag}': ubuntu-latest " + f"moves to new releases, so the bundle " + f"stops matching and every run falls back " + f"to the apt mirror. Pin runs-on to " + f"{series(tag)}.") + def check_ccache(self, label: str, tags: list, job: dict) -> None: """ccache-setup installs ccache from whatever bundle the job unpacked. @@ -254,6 +272,10 @@ def check_step(self, path: pathlib.Path, job_id: str, job: dict, tags = resolve(tag_raw, job) packages = resolve(with_.get("packages"), job) runners = resolve(job.get("runs-on"), job) or [""] + pairs = [(runner, tag) for runner in runners for tag in tags] + called = {(runners[0], tag) for tag in tags} if packages else set() + if not job_container(job): + self.check_runners(where, label, pairs, called) if not tags or not packages: self.unchecked.append(f"{label}: {tag_raw} / " f"{with_.get('packages')}") diff --git a/.github/scripts/check-workflows.py b/.github/scripts/check-workflows.py index 304eeba3664..e681b1d5603 100755 --- a/.github/scripts/check-workflows.py +++ b/.github/scripts/check-workflows.py @@ -23,13 +23,17 @@ # * every `run:` step is under the hard cap (error) and under the soft # warning threshold (warning, so a growing list is noticed with # runway left rather than at the cliff) +# * a job's worst-case apt setup fits in its timeout-minutes, and every +# parallel-make-check.py call has a --deadline that fits after it # # Findings are emitted as GitHub workflow commands (::error / ::warning) # so they surface as annotations on the run, and as plain text so the log # is readable when run locally. import argparse +import functools import pathlib +import re import sys import yaml @@ -41,6 +45,24 @@ # offending content out of the workflow before it becomes a failure. SOFT_LIMIT = 18000 +# Seconds of timeout-minutes left for checkout and the build after setup. +SETUP_MARGIN = 120 + +# Seconds left around a parallel-make-check --deadline for the steps before +# it (setup-python, brew) and after it (logs, cache save). +DEADLINE_MARGIN = 300 + +# apt-install.sh's split_budget() limits and kill grace. +UPDATE_MIN, UPDATE_MAX, INSTALL_MIN, KILL_GRACE = 20, 90, 40, 10 + +# The apt-install.sh limits ccache-setup falls back to. +CCACHE_APT = {"tries": 2, "update": 60, "install": 90} + +ACTIONS = pathlib.Path(__file__).resolve().parent.parent / "actions" +PMC_OPTION = re.compile(r"--(timeout|deadline)[= ]\s*['\"]?([^\s'\"\\]+)") +APT_OPTION = re.compile(r"--(tries|budget|delay|update-timeout|" + r"install-timeout)[= ]\s*['\"]?([^\s'\"\\]+)") + def iter_run_steps(doc: object) -> list[tuple[str, str]]: """Yield (location, script) for every `run:` step in a parsed file. @@ -80,6 +102,149 @@ def scan_steps(steps: object, where: str) -> None: return found +@functools.cache +def apt_defaults() -> dict: + """The install-apt-deps input defaults, read from the action itself.""" + doc = yaml.safe_load((ACTIONS / "install-apt-deps" / "action.yml") + .read_text()) + return {k: v.get("default", "") for k, v in doc["inputs"].items()} + + +def apt_install_worst(tries: int, budget: int = 0, delay: int = 5, + update: int = 90, install: int = 300) -> int: + """Worst-case seconds of apt-install.sh, replaying its budget split.""" + spent = 0 + for n in range(1, tries + 1): + up, inst = update, install + if budget: + per = int((budget - spent) / (tries - n + 1)) + up = min(UPDATE_MAX, max(UPDATE_MIN, int(per / 2))) + inst = max(INSTALL_MIN, per - up) + spent += up + inst + 2 * KILL_GRACE + if n < tries: + spent += delay + delay *= 2 + return spent + + +def apt_worst(inputs: dict) -> int: + """Worst-case seconds of one install-apt-deps step, or -1 if unknown.""" + try: + pull = int(inputs["pull-timeout"]) + KILL_GRACE + worst = apt_install_worst(int(inputs["retries"]), + int(inputs["budget-seconds"]), + int(inputs["retry-delay"])) + except (KeyError, TypeError, ValueError): + return -1 + return worst + (pull if inputs.get("ghcr-debs-tag") else 0) + + +def invocations(run: object, name: str) -> list: + """The rest of the command line after each mention of name in a script.""" + script = "\n".join(line for line in str(run or "").splitlines() + if not line.lstrip().startswith("#")) + return [re.split(r"(? int: + """Check each job's apt setup and run deadlines against timeout-minutes.""" + errors = 0 + jobs = doc.get("jobs") if isinstance(doc, dict) else None + if not isinstance(jobs, dict): + return 0 + + def error(where: str, msg: str) -> None: + nonlocal errors + print(f"::error file={path}::{where}: {msg}") + errors += 1 + + for job_id, job in jobs.items(): + if not isinstance(job, dict) or not isinstance(job.get("steps"), list): + continue + always = 0 + # install-apt-deps steps behind different if: texts are taken as + # alternatives; steps behind the same one add up. + branches: dict[str, int] = {} + runs = [] + for i, step in enumerate(job["steps"]): + if not isinstance(step, dict): + continue + where = f"jobs.{job_id} / {step.get('name') or f'step {i + 1}'}" + run = step.get("run") + for cmd in invocations(run, "parallel-make-check.py"): + runs.append((where, dict(PMC_OPTION.findall(cmd)))) + for cmd in invocations(run, "apt-install.sh"): + opts = dict(APT_OPTION.findall(cmd)) + try: + always += apt_install_worst( + int(opts.pop("tries", 3)), + **{k.split("-")[0]: int(v) for k, v in opts.items()}) + except ValueError: + error(where, "give apt-install.sh's options literal " + "numbers so the setup budget can be checked") + uses = str(step.get("uses") or "") + if uses.endswith("/install-apt-deps"): + with_ = step.get("with") + cost = apt_worst({**defaults, + **(with_ if isinstance(with_, dict) + else {})}) + if cost < 0: + error(where, "give retries, retry-delay, budget-seconds " + "and pull-timeout literal numbers so the " + "setup budget can be checked") + elif "if" in step: + cond = str(step["if"]) + branches[cond] = branches.get(cond, 0) + cost + else: + always += cost + elif uses.endswith("/ccache-setup") \ + and "macos" not in str(job.get("runs-on", "")): + always += apt_install_worst(**CCACHE_APT) + setup = always + max(branches.values(), default=0) + + limit = job.get("timeout-minutes", 360) + fixed = isinstance(limit, (int, float)) + if fixed and setup and setup + SETUP_MARGIN > limit * 60: + need = -(-(setup + SETUP_MARGIN) // 60) + error(f"jobs.{job_id}", + f"apt setup can take {setup}s against a slow or dead " + f"mirror, which leaves no room in timeout-minutes: {limit}. " + f"The job is then cancelled instead of failing with the " + f"apt error. Raise timeout-minutes to at least {need}, or " + f"lower budget-seconds / pull-timeout.") + + deadlines = 0.0 + for where, opts in runs: + traw, draw = opts.get("timeout", ""), opts.get("deadline", "") + if "$" in traw + draw: + print(f"::warning file={path}::{where}: --timeout/--deadline " + f"is not a literal, so it is not checked") + continue + try: + timeout, deadline = float(traw), float(draw) + except ValueError: + timeout = deadline = -1.0 + if timeout <= 0 or deadline <= 0 or timeout > deadline: + error(where, f"parallel-make-check.py needs --timeout and " + f"--deadline above 0 with --timeout no larger, " + f"got --timeout='{traw}' --deadline='{draw}'. " + f"Without them a wedged config runs into " + f"timeout-minutes, which cancels the job and " + f"loses every config's log.") + continue + deadlines += deadline + need = -(-(setup + deadlines * 60 + DEADLINE_MARGIN) // 60) + if fixed and need > limit: + error(where, f"--deadline={draw} plus {setup}s of worst-case " + f"apt setup does not fit timeout-minutes: " + f"{limit}, so the job can be cancelled before " + f"the deadline fires. Raise timeout-minutes to " + f"at least {int(need)}, or lower --deadline.") + + return errors + + def check_file(path: pathlib.Path) -> tuple[int, int, int]: """Lint one file. Returns (errors, warnings, largest run: step).""" errors = 0 @@ -113,13 +278,15 @@ def check_file(path: pathlib.Path) -> tuple[int, int, int]: f"limit the whole file stops loading.") warnings += 1 + errors += check_timeouts(path, doc, apt_defaults()) + return (errors, warnings, biggest) def main() -> int: p = argparse.ArgumentParser( description="Lint GitHub Actions workflow files for the 21000 " - "character per-run-step limit.") + "character per-run-step limit and job time budgets.") p.add_argument("paths", nargs="*", metavar="FILE", help="files to check (default: all workflows and " "composite actions under .github/)") @@ -151,7 +318,7 @@ def main() -> int: print(f"checked {len(paths)} files; largest run: step is {biggest} " f"characters (limit {HARD_LIMIT})") if errors: - print(f"FAILED: {errors} step(s) over the limit") + print(f"FAILED: {errors} error(s)") return 1 if warnings: print(f"{warnings} step(s) approaching the limit") diff --git a/.github/scripts/parallel-make-check.py b/.github/scripts/parallel-make-check.py index a1705dee16e..0a2525d930c 100755 --- a/.github/scripts/parallel-make-check.py +++ b/.github/scripts/parallel-make-check.py @@ -96,6 +96,8 @@ # every other config's result and skips any "upload logs on failure" step, # since a job timeout cancels rather than fails. With it only the wedged # config dies, as a failure, and its make-check.log is still reported. +# --deadline bounds the whole run from the script's start, so it also stops +# configs that started late; each one it cuts off reports "run deadline". from __future__ import annotations @@ -162,8 +164,11 @@ class Config: # exactly one config is reported as the origin) and kills the other # workers' in-flight process groups. stop_event = threading.Event() +deadline_event = threading.Event() fail_lock = threading.Lock() live_procs: set[subprocess.Popen] = set() +# Processes the --deadline sweep signalled while they were still running. +deadline_killed: set[subprocess.Popen] = set() procs_lock = threading.Lock() @@ -179,9 +184,11 @@ def kill_group(p: subprocess.Popen, sig: signal.Signals) -> None: pass -def abort_others() -> None: +def abort_others(for_deadline: bool = False) -> None: with procs_lock: procs = list(live_procs) + if for_deadline: + deadline_killed.update(p for p in procs if p.poll() is None) for p in procs: kill_group(p, signal.SIGTERM) # Bounded escalation: SIGKILL whatever ignored the SIGTERM, so @@ -203,9 +210,9 @@ def wait_bounded(p: subprocess.Popen, # abort_others() does - SIGTERM, then SIGKILL after a 10 s grace - so a # test that traps SIGTERM cannot outlive its timeout. Returns the exit # status and whether the deadline ended the wait. - if deadline is None: - return p.wait(), False try: + if deadline is None: + return p.wait(), False return p.wait(timeout=max(0.0, deadline - time.monotonic())), False except subprocess.TimeoutExpired: kill_group(p, signal.SIGTERM) @@ -215,6 +222,9 @@ def wait_bounded(p: subprocess.Popen, kill_group(p, signal.SIGKILL) p.wait() return -1, True + except KeyboardInterrupt: + kill_group(p, signal.SIGTERM) + raise def nproc() -> int: @@ -430,10 +440,22 @@ def stale_estimate(cfg: Config, minutes: float) -> bool: and not 0.5 * cfg.minutes <= minutes <= 1.5 * cfg.minutes) +def aborted_by_failure(opts: argparse.Namespace) -> bool: + # True when fail-fast stopped the run for a real failure. + return (opts.fail_fast and stop_event.is_set() + and not deadline_event.is_set()) + + +def failed_step(label: str) -> str: + return label.removeprefix("run deadline in ").removeprefix("timeout in ") + + def run_config(cfg: Config, opts: argparse.Namespace) -> tuple[str | None, float]: - if opts.fail_fast and stop_event.is_set(): + if aborted_by_failure(opts): return "aborted", 0.0 + if opts.run_deadline is not None and time.monotonic() >= opts.run_deadline: + return "run deadline before start", 0.0 bdir = SRCDIR / f"build-{cfg.name}" if bdir.exists(): shutil.rmtree(bdir) @@ -482,23 +504,43 @@ def run_config(cfg: Config, opts: argparse.Namespace) -> tuple[str | None, # Budget for the whole step sequence, not per step: the total is what # has to stay under the CI job's timeout-minutes. deadline = start + opts.timeout * 60 if opts.timeout else None + run_binds = opts.run_deadline is not None \ + and (deadline is None or opts.run_deadline <= deadline) + if run_binds: + deadline = opts.run_deadline log = bdir / "make-check.log" def record_failure(step: str) -> str: - # Classify a failed step, doing the fail-fast bookkeeping: the - # first failure wins and aborts everyone else; any failure after - # the abort began is reported as aborted instead. + # Under fail-fast the first failure aborts the others, and failures + # after an abort that a failure began are reported as aborted. if not opts.fail_fast: return step with fail_lock: - label = "aborted" if stop_event.is_set() else step + first = not stop_event.is_set() stop_event.set() - if label != "aborted": + if first: abort_others() + return step if first or deadline_event.is_set() else "aborted" + + def deadline_failure(label: str) -> str: + # Every config the deadline cuts off keeps its own label and log. + if opts.fail_fast: + with fail_lock: + first = not stop_event.is_set() + deadline_event.set() + stop_event.set() + if first: + abort_others(for_deadline=True) return label with open(log, "w") as logf: for step, cmd in steps: + if run_binds and time.monotonic() >= opts.run_deadline \ + and not aborted_by_failure(opts): + print(f"+ skipped: {step} after --deadline=" + f"{opts.deadline:g} min", file=logf, flush=True) + failed = deadline_failure(f"run deadline before {step}") + break if opts.fail_fast and stop_event.is_set(): failed = "aborted" break @@ -527,6 +569,8 @@ def record_failure(step: str) -> str: # just now, this process escaped the sweep - kill it # ourselves (the wait() below then reaps it), escalating # like the sweep does if SIGTERM is ignored. + if deadline_event.is_set(): + deadline_killed.add(proc) kill_group(proc, signal.SIGTERM) try: proc.wait(timeout=10) @@ -537,6 +581,12 @@ def record_failure(step: str) -> str: finally: with procs_lock: live_procs.discard(proc) + if run_binds and (timed_out or proc in deadline_killed) \ + and not aborted_by_failure(opts): + print(f"+ killed: {step} hit --deadline={opts.deadline:g} " + f"min", file=logf, flush=True) + failed = deadline_failure(f"run deadline in {step}") + break if timed_out: print(f"+ killed: {step} exceeded --timeout={opts.timeout:g} " f"min", file=logf, flush=True) @@ -561,9 +611,9 @@ def record_failure(step: str) -> str: sys.stdout.flush() else: dump(f"{cfg.name}: FAIL ({failed}) [{minutes:.1f} min]", log) - if failed == "configure": + if failed_step(failed) == "configure": dump(f"{cfg.name}: config.log", bdir / "config.log") - elif failed == "make check": + elif failed_step(failed) == "make check": dump(f"{cfg.name}: test-suite.log", bdir / "test-suite.log") return failed, minutes @@ -662,6 +712,13 @@ def main() -> int: "every other config's result with it (default: 0, " "no limit). Set it well above the slowest config's " "normal time - this catches hangs, not slowness") + p.add_argument("--deadline", type=float, default=0, metavar="MINUTES", + help="wall-clock limit for the whole run, counted from " + "start: configs still running are killed and pending " + "ones fail without starting, so the summary and logs " + "come out before the CI job's timeout-minutes, " + "including for a config that started late " + "(default: 0, no limit)") p.add_argument("--cc", default="ccache gcc" if shutil.which("ccache") else None, help="compiler passed to configure as CC= for configs " @@ -688,6 +745,10 @@ def main() -> int: opts = p.parse_args() if opts.timeout < 0: p.error("--timeout must be a non-negative number of minutes") + if opts.deadline < 0: + p.error("--deadline must be a non-negative number of minutes") + opts.run_deadline = (time.monotonic() + opts.deadline * 60 + if opts.deadline else None) all_configs = load_configs(opts, p.error) if opts.build_only: @@ -767,7 +828,16 @@ def main() -> int: return 0 if any(cfg.build for cfg in selected) and not (SRCDIR / "configure").exists(): - subprocess.run(["./autogen.sh"], cwd=SRCDIR, check=True) + proc = subprocess.Popen(["./autogen.sh"], cwd=SRCDIR, + start_new_session=True) + rc, timed_out = wait_bounded(proc, opts.run_deadline) + if timed_out: + msg = f"autogen.sh hit --deadline={opts.deadline:g} min" + print(f"::error{GH_FILE_PROP}::{gh_escape(msg)}" + if ON_GITHUB else msg) + return 1 + if rc != 0: + raise subprocess.CalledProcessError(rc, ["./autogen.sh"]) nthreads = max(1, min(opts.threads, len(selected))) wall_start = time.monotonic() diff --git a/.github/scripts/test_ci_scripts.py b/.github/scripts/test_ci_scripts.py new file mode 100755 index 00000000000..1d18499d509 --- /dev/null +++ b/.github/scripts/test_ci_scripts.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python3 +# Tests for check-workflows.py and parallel-make-check.py. +# +# python3 -m unittest discover -s .github/scripts -p 'test_*.py' + +import contextlib +import importlib.util +import io +import json +import os +import pathlib +import re +import shutil +import signal +import subprocess +import sys +import tempfile +import time +import unittest +from unittest import mock + +SCRIPTS = pathlib.Path(__file__).resolve().parent +ACTIONS = SCRIPTS.parent / "actions" + + +def load(name: str, path: pathlib.Path): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +cw = load("check_workflows", SCRIPTS / "check-workflows.py") +deps = load("check_ci_deps", SCRIPTS / "check-ci-deps.py") + + +class AptModel(unittest.TestCase): + def test_worst_cases(self): + self.assertEqual(cw.apt_install_worst(2, budget=120), 175) + self.assertEqual(cw.apt_install_worst(2, budget=600), 620) + self.assertEqual(cw.apt_install_worst(2), 825) + self.assertEqual(cw.apt_install_worst(**cw.CCACHE_APT), 345) + inputs = {**cw.apt_defaults(), "ghcr-debs-tag": "ubuntu-24.04-full"} + self.assertEqual(cw.apt_worst(inputs), 130 + 620) + + def test_matches_the_scripts(self): + script = (ACTIONS / "install-apt-deps/apt-install.sh").read_text() + for line in ("update_timeout=90", "install_timeout=300", "delay=5", + f'[ "$update_timeout" -le {cw.UPDATE_MAX} ]', + f'[ "$update_timeout" -ge {cw.UPDATE_MIN} ]', + f'[ "$install_timeout" -ge {cw.INSTALL_MIN} ]', + f"timeout -k {cw.KILL_GRACE} "): + self.assertIn(line, script) + ccache = (ACTIONS / "ccache-setup/action.yml").read_text() + self.assertIn(f"--tries {cw.CCACHE_APT['tries']}", ccache) + self.assertIn(f"--update-timeout {cw.CCACHE_APT['update']}", ccache) + self.assertIn(f"--install-timeout {cw.CCACHE_APT['install']}", ccache) + + +APT = {"uses": "./.github/actions/install-apt-deps", + "with": {"packages": "p", "ghcr-debs-tag": "ubuntu-24.04-full"}} + + +def errors(limit: object, steps: list) -> int: + doc = {"jobs": {"j": {"timeout-minutes": limit, "steps": steps}}} + # Keep the ::error lines out of a CI log, where they would annotate. + with contextlib.redirect_stdout(io.StringIO()): + return cw.check_timeouts(pathlib.Path("t.yml"), doc, cw.apt_defaults()) + + +def run(opts: str) -> dict: + return {"run": f".github/scripts/parallel-make-check.py {opts} c.json"} + + +class CheckTimeouts(unittest.TestCase): + def test_setup(self): + self.assertEqual(errors(15, [APT]), 0) + self.assertEqual(errors(14, [APT]), 1) + + def test_conditional_setup(self): + a = {**APT, "if": "inputs.p == 'a'"} + b = {**APT, "if": "inputs.p == 'b'"} + self.assertEqual(errors(15, [a, b]), 0) + self.assertEqual(errors(27, [a, a]), 0) + self.assertEqual(errors(26, [a, a]), 1) + + def test_direct_apt_install(self): + call = {"run": "x/apt-install.sh --tries 2 \\\n" + " --warn-only --budget 600 pkg || true"} + self.assertEqual(errors(13, [call]), 0) + self.assertEqual(errors(12, [call]), 1) + bad = {"run": 'x/apt-install.sh --tries "$N"'} + self.assertEqual(errors(60, [bad]), 1) + + def test_run_bounds(self): + ok = run("--timeout=10 --deadline=20") + self.assertEqual(errors(25, [ok]), 0) + self.assertEqual(errors(24, [ok]), 1) + self.assertEqual(errors(45, [ok, ok]), 0) + self.assertEqual(errors(44, [ok, ok]), 1) + self.assertEqual(errors(60, [run("--timeout=10")]), 1) + two = {"run": ok["run"] + "\n" + ok["run"]} + self.assertEqual(errors(45, [two]), 0) + self.assertEqual(errors(44, [two]), 1) + self.assertEqual(errors(60, [{"run": run("")["run"] + "\n" + + ok["run"]}]), 1) + self.assertEqual(errors(60, [run("--timeout=30 --deadline=20")]), 1) + noted = {"run": "# parallel-make-check.py runs below\n" + ok["run"]} + self.assertEqual(errors(25, [noted]), 0) + self.assertEqual(errors(60, [run("--timeout=${{ m.t }} " + "--deadline=20")]), 0) + + +class CheckRunners(unittest.TestCase): + def errors(self, pairs: list, called: set = frozenset()) -> int: + with mock.patch.object(deps, "bundle_images", dict): + checker = deps.Checker({}, stream=io.StringIO()) + checker.check_runners("w", "j", pairs, set(called)) + return checker.errors + + def test_runner_matches_tag(self): + full = "ubuntu-24.04-full" + self.assertEqual(self.errors([("ubuntu-24.04", full)]), 0) + self.assertEqual(self.errors([("ubuntu-24.04", full), + ("ubuntu-22.04", full)]), 1) + self.assertEqual(self.errors([("ubuntu-22.04", full)], + {("ubuntu-22.04", full)}), 0) + self.assertEqual(self.errors([("ubuntu-latest", full)]), 1) + + +class Deadline(unittest.TestCase): + @contextlib.contextmanager + def tree(self, configs: list, autogen: str = "", configure: str = ""): + # Yields a fake source tree and the runner's command line for it. + with tempfile.TemporaryDirectory() as tmp: + scripts = pathlib.Path(tmp) / ".github/scripts" + scripts.mkdir(parents=True) + shutil.copy(SCRIPTS / "parallel-make-check.py", scripts) + for name, body in (("autogen.sh", autogen), + ("configure", configure)): + if body: + script = pathlib.Path(tmp) / name + script.write_text(f"#!/bin/sh\n{body}\n") + script.chmod(0o755) + cfg = pathlib.Path(tmp) / "cfg.json" + cfg.write_text(json.dumps(configs)) + yield pathlib.Path(tmp), [ + sys.executable, str(scripts / "parallel-make-check.py"), + "--threads", "2", "--timeout", "5", str(cfg)] + + def run_pmc(self, configs: list, *opts: str, autogen: str = "", + configure: str = "") -> tuple[int, dict]: + with self.tree(configs, autogen, configure) as (_, argv): + out = subprocess.run(argv[:-1] + list(opts) + argv[-1:], + capture_output=True, text=True, timeout=120, + env={"PATH": "/usr/bin:/bin"}) + self.stdout = out.stdout + return out.returncode, dict(re.findall( + r"^\| (\w+) \| (.+?) \| [\d.]+ \|$", out.stdout, re.M)) + + def config(self, name: str, minutes: float, *cmd: str) -> dict: + return {"name": name, "minutes": minutes, "build": False, + "run": [list(cmd)]} + + def test_every_config_cut_off_is_labelled(self): + configs = [self.config("a", 3, "sleep", "600"), + self.config("b", 2, "sleep", "600"), + self.config("c", 1, "sleep", "1")] + for mode in ("--fail-fast", "--no-fail-fast"): + with self.subTest(mode=mode): + rc, got = self.run_pmc(configs, mode, "--deadline", "0.05") + self.assertEqual(rc, 1) + self.assertIn("run deadline in sleep 600", got["a"]) + self.assertIn("run deadline in sleep 600", got["b"]) + self.assertIn("run deadline before", got["c"]) + + def test_real_failure_is_not_a_deadline(self): + configs = [self.config("bad", 3, "bash", "-c", "sleep 1; exit 1"), + self.config("b", 2, "sleep", "600"), + self.config("c", 1, "sleep", "1")] + rc, got = self.run_pmc(configs, "--fail-fast", "--deadline", "0.05") + self.assertEqual(rc, 1) + self.assertIn("FAIL (bash -c sleep 1; exit 1)", got["bad"]) + self.assertIn("aborted", got["b"]) + self.assertIn("aborted", got["c"]) + + def test_failure_seen_after_deadline(self): + # A step that fails before the deadline but is seen after it keeps + # its own label. + step = "kill -STOP $PPID; (sleep 5; kill -CONT $PPID) & exit 9" + rc, got = self.run_pmc([self.config("a", 1, "sh", "-c", step)], + "--deadline", "0.05") + self.assertEqual(rc, 1) + self.assertIn("FAIL (sh -c", got["a"]) + + def test_timeout_across_deadline_is_not_aborted(self): + # b's --timeout kill is still in its grace when c hits the deadline. + slow = "trap 'sleep 3; exit 9' TERM; sleep 600 & wait" + configs = [self.config("b", 3, "sh", "-c", slow), + self.config("a", 2, "sleep", "2"), + self.config("c", 1, "sleep", "600")] + rc, got = self.run_pmc(configs, "--fail-fast", "--timeout", "0.08", + "--deadline", "0.1") + self.assertEqual(rc, 1) + self.assertIn("timeout in sh -c", got["b"]) + self.assertIn("run deadline in sleep 600", got["c"]) + + def test_timeout_dumps_step_log(self): + rc, got = self.run_pmc([{"name": "a", "minutes": 1}], + "--timeout", "0.05", "--deadline", "1", + configure="echo marker >config.log; sleep 600") + self.assertEqual(rc, 1) + self.assertIn("timeout in configure", got["a"]) + self.assertIn("==== a: config.log ====\nmarker", self.stdout) + + def test_autogen_is_bounded(self): + configs = [{"name": "a", "minutes": 1}] + rc, _ = self.run_pmc(configs, "--deadline", "0.05", + autogen="sleep 600") + self.assertEqual(rc, 1) + self.assertIn("autogen.sh hit --deadline", self.stdout) + + def test_interrupt_stops_autogen(self): + autogen = "echo $$ >pid.tmp; mv pid.tmp autogen.pid; exec sleep 600" + with self.tree([{"name": "a", "minutes": 1}], autogen) as (tmp, argv): + runner = subprocess.Popen( + argv, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + env={"PATH": "/usr/bin:/bin"}, + preexec_fn=lambda: signal.signal(signal.SIGINT, + signal.SIG_DFL)) + try: + pid_file = tmp / "autogen.pid" + end = time.monotonic() + 60 + while not pid_file.exists() and time.monotonic() < end: + time.sleep(0.1) + self.assertTrue(pid_file.exists(), "autogen.sh never ran") + runner.send_signal(signal.SIGINT) + runner.wait(timeout=60) + finally: + if runner.poll() is None: + runner.kill() + runner.wait() + pid = int(pid_file.read_text()) + end = time.monotonic() + 10 + while time.monotonic() < end: + try: + os.kill(pid, 0) + except ProcessLookupError: + return + time.sleep(0.1) + os.kill(pid, signal.SIGKILL) + self.fail("autogen.sh outlived an interrupted runner") + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/workflows/aesgcm-siv.yml b/.github/workflows/aesgcm-siv.yml index 507c637a047..553a6ec96d0 100644 --- a/.github/workflows/aesgcm-siv.yml +++ b/.github/workflows/aesgcm-siv.yml @@ -89,7 +89,7 @@ jobs: name: Cross-arch test if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-22.04 - timeout-minutes: 25 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -150,6 +150,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ "$RUNNER_TEMP/aesgcm-siv-configs.json" diff --git a/.github/workflows/afalg.yml b/.github/workflows/afalg.yml index f7c9dd55a51..1f9f290dd5b 100644 --- a/.github/workflows/afalg.yml +++ b/.github/workflows/afalg.yml @@ -35,7 +35,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 20 + timeout-minutes: 45 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -83,7 +83,7 @@ jobs: if [ -n "$missing" ]; then grep -rn 'algif_' /etc/modprobe.d /lib/modprobe.d || true .github/actions/install-apt-deps/apt-install.sh --tries 2 \ - --warn-only --drop-vendor-sources \ + --budget 600 --warn-only --drop-vendor-sources \ "linux-modules-extra-$(uname -r)" || true for m in $missing; do if sudo modprobe --ignore-install "$m"; then @@ -178,6 +178,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/afalg-configs.json" diff --git a/.github/workflows/async.yml b/.github/workflows/async.yml index efaa7d46310..d9f8322b134 100644 --- a/.github/workflows/async.yml +++ b/.github/workflows/async.yml @@ -34,7 +34,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 20 + timeout-minutes: 45 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -106,6 +106,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=18 \ + --deadline=20 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/async-configs.json" diff --git a/.github/workflows/bind.yml b/.github/workflows/bind.yml index 9164461ad4c..fc9c9752ee2 100644 --- a/.github/workflows/bind.yml +++ b/.github/workflows/bind.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -53,7 +53,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 10 + timeout-minutes: 15 needs: build_wolfssl steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/check-source-text.yml b/.github/workflows/check-source-text.yml index 99de8088b06..47187b1eeaf 100644 --- a/.github/workflows/check-source-text.yml +++ b/.github/workflows/check-source-text.yml @@ -8,10 +8,13 @@ name: Check Source Text # * bash -n + shellcheck (warning level) on shell scripts. # * check-workflows.py: every `run:` step against GitHub's 21000 # character cap, past which GitHub stops loading the workflow file -# altogether and its runs fail in 0s with zero jobs. +# altogether and its runs fail in 0s with zero jobs, and each job's +# apt setup budget and parallel-make-check.py --timeout/--deadline. # * check-ci-deps.py: every install-apt-deps call against the .deb bundle # it names, since a package missing from the bundle costs that job the # apt mirror without failing anything. +# * test_ci_scripts.py: unit tests for check-workflows.py, +# check-ci-deps.py and parallel-make-check.py. # # Scope: # * pull_request: only files changed in the PR (catches new violations @@ -37,7 +40,7 @@ jobs: # Only run from the wolfssl org to avoid burning forks' CI minutes. if: github.repository_owner == 'wolfssl' runs-on: ubuntu-24.04 - timeout-minutes: 5 + timeout-minutes: 7 steps: # The PR merge commit and its base parent are all the diff needs. - uses: actions/checkout@v5 @@ -91,6 +94,9 @@ jobs: - name: Check the ci-deps bundle contract run: ./.github/scripts/check-ci-deps.py + - name: Test the CI scripts + run: python3 -m unittest discover -s .github/scripts -p 'test_*.py' + - name: Run check-source-text (PR changed files) if: github.event_name == 'pull_request' && steps.files.outputs.count != '0' run: | diff --git a/.github/workflows/cryptocb-only.yml b/.github/workflows/cryptocb-only.yml index d692bab88fb..5b31f884988 100644 --- a/.github/workflows/cryptocb-only.yml +++ b/.github/workflows/cryptocb-only.yml @@ -42,7 +42,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction of this. - timeout-minutes: 40 + timeout-minutes: 80 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -211,6 +211,8 @@ jobs: ]} EOF .github/scripts/parallel-make-check.py \ + --timeout=44 \ + --deadline=55 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --shard "${{ matrix.shard }}/${{ strategy.job-total }}" \ --private-dir=certs \ diff --git a/.github/workflows/curl.yml b/.github/workflows/curl.yml index 09739b1f991..31a7d62a27f 100644 --- a/.github/workflows/curl.yml +++ b/.github/workflows/curl.yml @@ -22,7 +22,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/cyrus-sasl.yml b/.github/workflows/cyrus-sasl.yml index c4a5bc3c97e..667a5073c38 100644 --- a/.github/workflows/cyrus-sasl.yml +++ b/.github/workflows/cyrus-sasl.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -54,7 +54,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 7 needs: build_wolfssl steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/disable-pk-algs.yml b/.github/workflows/disable-pk-algs.yml index 094ec8173b0..efc0d81d291 100644 --- a/.github/workflows/disable-pk-algs.yml +++ b/.github/workflows/disable-pk-algs.yml @@ -34,7 +34,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 15 + timeout-minutes: 45 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -130,6 +130,8 @@ jobs: ]} EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=18 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/disable-pk-algs-configs.json" diff --git a/.github/workflows/docker-OpenWrt.yml b/.github/workflows/docker-OpenWrt.yml index 7357b0ce392..4e3a799fb55 100644 --- a/.github/workflows/docker-OpenWrt.yml +++ b/.github/workflows/docker-OpenWrt.yml @@ -30,7 +30,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 container: image: alpine:latest steps: diff --git a/.github/workflows/enterprise.yml b/.github/workflows/enterprise.yml index ef1956e85e3..d0ee4e367c1 100644 --- a/.github/workflows/enterprise.yml +++ b/.github/workflows/enterprise.yml @@ -39,7 +39,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 45 + timeout-minutes: 55 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -87,6 +87,8 @@ jobs: - name: Build and make check this shard's configs (parallel, out-of-tree) run: | .github/scripts/parallel-make-check.py \ + --timeout=27 \ + --deadline=27 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --shard "${{ matrix.shard }}/${{ strategy.job-total }}" \ --extra-cflags='-pedantic -Wdeclaration-after-statement -Wnull-dereference -Wno-overlength-strings -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE' \ @@ -137,7 +139,7 @@ jobs: options: '-DWOLFSSL_RENEGOTIATION_INDICATION=yes' if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 30 + timeout-minutes: 45 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -193,7 +195,7 @@ jobs: name: cmake reconfigure if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 10 + timeout-minutes: 15 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL diff --git a/.github/workflows/falcon-interop.yml b/.github/workflows/falcon-interop.yml index 0777ad175f1..790a545aa6a 100644 --- a/.github/workflows/falcon-interop.yml +++ b/.github/workflows/falcon-interop.yml @@ -155,37 +155,37 @@ jobs: fail-fast: false matrix: include: - - { name: 'default', runner: ubuntu-latest, opts: '--enable-falcon' } - - { name: 'asm', runner: ubuntu-latest, opts: '--enable-falcon=asm' } - - { name: 'double', runner: ubuntu-latest, opts: '--enable-falcon=double' } - - { name: 'avx2', runner: ubuntu-latest, opts: '--enable-falcon=avx2', avx2: true } - - { name: 'small-mem', runner: ubuntu-latest, opts: '--enable-falcon=small-mem' } - - { name: 'avx2+small-mem', runner: ubuntu-latest, opts: '--enable-falcon=avx2,small-mem', avx2: true } + - { name: 'default', runner: ubuntu-24.04, opts: '--enable-falcon' } + - { name: 'asm', runner: ubuntu-24.04, opts: '--enable-falcon=asm' } + - { name: 'double', runner: ubuntu-24.04, opts: '--enable-falcon=double' } + - { name: 'avx2', runner: ubuntu-24.04, opts: '--enable-falcon=avx2', avx2: true } + - { name: 'small-mem', runner: ubuntu-24.04, opts: '--enable-falcon=small-mem' } + - { name: 'avx2+small-mem', runner: ubuntu-24.04, opts: '--enable-falcon=avx2,small-mem', avx2: true } # -ffp-contract=off: --enable-falcon=neon implies the native double fpr # seam, and aarch64 has baseline FMA with contraction on by default, so # without this even the scalar ops can round differently here. - { name: 'neon (ARM64)', runner: ubuntu-24.04-arm, opts: '--enable-falcon=neon', cflags: '-ffp-contract=off' } - - { name: 'cache-key', runner: ubuntu-latest, opts: '--enable-falcon=cache-key', full_suite: true } - - { name: 'cache-basis', runner: ubuntu-latest, opts: '--enable-falcon=cache-basis', full_suite: true } - - { name: 'cache-key+small-mem', runner: ubuntu-latest, opts: '--enable-falcon=cache-key,small-mem', full_suite: true } - - { name: 'smallest-mem', runner: ubuntu-latest, opts: '--enable-falcon=smallest-mem', full_suite: true } - - { name: 'smallest-mem (32-bit fpr)', runner: ubuntu-latest, opts: '--enable-falcon=smallest-mem', cflags: '-DWC_32BIT_CPU' } - - { name: 'asm+smallest-mem', runner: ubuntu-latest, opts: '--enable-falcon=asm,smallest-mem' } - - { name: 'avx2+smallest-mem', runner: ubuntu-latest, opts: '--enable-falcon=avx2,smallest-mem', avx2: true } + - { name: 'cache-key', runner: ubuntu-24.04, opts: '--enable-falcon=cache-key', full_suite: true } + - { name: 'cache-basis', runner: ubuntu-24.04, opts: '--enable-falcon=cache-basis', full_suite: true } + - { name: 'cache-key+small-mem', runner: ubuntu-24.04, opts: '--enable-falcon=cache-key,small-mem', full_suite: true } + - { name: 'smallest-mem', runner: ubuntu-24.04, opts: '--enable-falcon=smallest-mem', full_suite: true } + - { name: 'smallest-mem (32-bit fpr)', runner: ubuntu-24.04, opts: '--enable-falcon=smallest-mem', cflags: '-DWC_32BIT_CPU' } + - { name: 'asm+smallest-mem', runner: ubuntu-24.04, opts: '--enable-falcon=asm,smallest-mem' } + - { name: 'avx2+smallest-mem', runner: ubuntu-24.04, opts: '--enable-falcon=avx2,smallest-mem', avx2: true } - { name: 'neon+smallest-mem (ARM64)', runner: ubuntu-24.04-arm, opts: '--enable-falcon=neon,smallest-mem', cflags: '-ffp-contract=off' } - - { name: 'cache-key+smallest-mem', runner: ubuntu-latest, opts: '--enable-falcon=cache-key,smallest-mem', full_suite: true } - - { name: 'level1+dynamic-keys+smallest-mem', runner: ubuntu-latest, opts: '--enable-falcon=level1,dynamic-keys,smallest-mem', full_suite: true } - - { name: 'level1 only', runner: ubuntu-latest, opts: '--enable-falcon=level1', full_suite: true } - - { name: 'level5 only', runner: ubuntu-latest, opts: '--enable-falcon=level5', full_suite: true } - - { name: 'dynamic-keys', runner: ubuntu-latest, opts: '--enable-falcon=dynamic-keys', full_suite: true } - - { name: 'level1+dynamic-keys', runner: ubuntu-latest, opts: '--enable-falcon=level1,dynamic-keys', full_suite: true } - - { name: 'cache-key+dynamic-keys', runner: ubuntu-latest, opts: '--enable-falcon=cache-key,dynamic-keys', full_suite: true } - - { name: 'level5+dynamic-keys', runner: ubuntu-latest, opts: '--enable-falcon=level5,dynamic-keys', full_suite: true } - - { name: 'verify-no-malloc', runner: ubuntu-latest, opts: '--enable-falcon=verify-no-malloc', full_suite: true } - - { name: 'level1+dynamic-keys+verify-no-malloc', runner: ubuntu-latest, opts: '--enable-falcon=level1,dynamic-keys,verify-no-malloc', full_suite: true } + - { name: 'cache-key+smallest-mem', runner: ubuntu-24.04, opts: '--enable-falcon=cache-key,smallest-mem', full_suite: true } + - { name: 'level1+dynamic-keys+smallest-mem', runner: ubuntu-24.04, opts: '--enable-falcon=level1,dynamic-keys,smallest-mem', full_suite: true } + - { name: 'level1 only', runner: ubuntu-24.04, opts: '--enable-falcon=level1', full_suite: true } + - { name: 'level5 only', runner: ubuntu-24.04, opts: '--enable-falcon=level5', full_suite: true } + - { name: 'dynamic-keys', runner: ubuntu-24.04, opts: '--enable-falcon=dynamic-keys', full_suite: true } + - { name: 'level1+dynamic-keys', runner: ubuntu-24.04, opts: '--enable-falcon=level1,dynamic-keys', full_suite: true } + - { name: 'cache-key+dynamic-keys', runner: ubuntu-24.04, opts: '--enable-falcon=cache-key,dynamic-keys', full_suite: true } + - { name: 'level5+dynamic-keys', runner: ubuntu-24.04, opts: '--enable-falcon=level5,dynamic-keys', full_suite: true } + - { name: 'verify-no-malloc', runner: ubuntu-24.04, opts: '--enable-falcon=verify-no-malloc', full_suite: true } + - { name: 'level1+dynamic-keys+verify-no-malloc', runner: ubuntu-24.04, opts: '--enable-falcon=level1,dynamic-keys,verify-no-malloc', full_suite: true } # verify-only strips keygen/sign; the KAT verifies still run, and # this is the only config where the verify path is all there is. - - { name: 'verify-only', runner: ubuntu-latest, opts: '--enable-falcon', cppflags: '-DWOLFSSL_FALCON_VERIFY_ONLY' } + - { name: 'verify-only', runner: ubuntu-24.04, opts: '--enable-falcon', cppflags: '-DWOLFSSL_FALCON_VERIFY_ONLY' } steps: - name: Checkout wolfSSL uses: actions/checkout@v5 diff --git a/.github/workflows/fips-dev-no-post.yml b/.github/workflows/fips-dev-no-post.yml index 9cbeff4c8bb..f13490e5ada 100644 --- a/.github/workflows/fips-dev-no-post.yml +++ b/.github/workflows/fips-dev-no-post.yml @@ -49,7 +49,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # A cold-ccache run takes ~27 min, set by kernel-settings-all-pqc-asm. - timeout-minutes: 40 + timeout-minutes: 65 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -147,6 +147,8 @@ jobs: # "--enable-linuxkm-benchmarks", "--with-max-rsa-bits=16384", # "CFLAGS=-Wframe-larger-than=2048 -Wstack-usage=4096 -DBENCH_EMBEDDED -DBENCH_MIN_RUNTIME_SEC=0.01 -DBENCH_NTIMES=1 -DBENCH_AGREETIMES=1"]} .github/scripts/parallel-make-check.py \ + --timeout=41 \ + --deadline=41 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ "$RUNNER_TEMP/fips-dev-no-post-configs.json" diff --git a/.github/workflows/haproxy.yml b/.github/workflows/haproxy.yml index 65b7c6a7d5f..2c4681b3e5c 100644 --- a/.github/workflows/haproxy.yml +++ b/.github/workflows/haproxy.yml @@ -25,7 +25,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/hitch.yml b/.github/workflows/hitch.yml index 020018e088c..5834534a4c0 100644 --- a/.github/workflows/hitch.yml +++ b/.github/workflows/hitch.yml @@ -19,7 +19,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/intelasm-c-fallback.yml b/.github/workflows/intelasm-c-fallback.yml index 127df08a93c..eb558f705a6 100644 --- a/.github/workflows/intelasm-c-fallback.yml +++ b/.github/workflows/intelasm-c-fallback.yml @@ -28,7 +28,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 6 + timeout-minutes: 9 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL diff --git a/.github/workflows/ipmitool.yml b/.github/workflows/ipmitool.yml index 92d487a5dc0..bbbcf45a6dd 100644 --- a/.github/workflows/ipmitool.yml +++ b/.github/workflows/ipmitool.yml @@ -24,7 +24,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/jwt-cpp.yml b/.github/workflows/jwt-cpp.yml index af87dbdeea9..857eb7371fc 100644 --- a/.github/workflows/jwt-cpp.yml +++ b/.github/workflows/jwt-cpp.yml @@ -23,7 +23,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/krb5.yml b/.github/workflows/krb5.yml index 80810e9a30b..623a254e289 100644 --- a/.github/workflows/krb5.yml +++ b/.github/workflows/krb5.yml @@ -23,7 +23,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-22.04 # This should be a safe limit for the tests to run. - timeout-minutes: 5 + timeout-minutes: 8 steps: - name: workaround high-entropy ASLR # not needed after either an update to llvm or runner is done diff --git a/.github/workflows/libssh2.yml b/.github/workflows/libssh2.yml index bb1c8dd4a65..a3e5eeae7cc 100644 --- a/.github/workflows/libssh2.yml +++ b/.github/workflows/libssh2.yml @@ -23,7 +23,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/libvncserver.yml b/.github/workflows/libvncserver.yml index 8ec82b654d3..609822ee857 100644 --- a/.github/workflows/libvncserver.yml +++ b/.github/workflows/libvncserver.yml @@ -23,7 +23,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/linuxkm.yml b/.github/workflows/linuxkm.yml index bc30f9332b1..52998671830 100644 --- a/.github/workflows/linuxkm.yml +++ b/.github/workflows/linuxkm.yml @@ -28,7 +28,7 @@ jobs: name: build module if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 5 + timeout-minutes: 7 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL diff --git a/.github/workflows/memcached.yml b/.github/workflows/memcached.yml index b8c8139de5a..4acc7b04d27 100644 --- a/.github/workflows/memcached.yml +++ b/.github/workflows/memcached.yml @@ -22,7 +22,7 @@ jobs: # Just to keep it the same as the testing target if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/mono.yml b/.github/workflows/mono.yml index 36b632fde57..05cc498cf1c 100644 --- a/.github/workflows/mono.yml +++ b/.github/workflows/mono.yml @@ -21,7 +21,7 @@ jobs: name: Build wolfSSL C# Wrapper if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 10 + timeout-minutes: 15 steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/mosquitto.yml b/.github/workflows/mosquitto.yml index dbea1074939..7d31f46ba1d 100644 --- a/.github/workflows/mosquitto.yml +++ b/.github/workflows/mosquitto.yml @@ -23,7 +23,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -51,7 +51,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 7 needs: build_wolfssl steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/msmtp.yml b/.github/workflows/msmtp.yml index 1596a8da22e..bce9abf8815 100644 --- a/.github/workflows/msmtp.yml +++ b/.github/workflows/msmtp.yml @@ -23,7 +23,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -51,7 +51,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 10 + timeout-minutes: 15 needs: build_wolfssl steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/multi-arch.yml b/.github/workflows/multi-arch.yml index c580ecd7c16..bff158f907f 100644 --- a/.github/workflows/multi-arch.yml +++ b/.github/workflows/multi-arch.yml @@ -32,7 +32,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-22.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 35 + timeout-minutes: 75 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -76,6 +76,8 @@ jobs: - name: Build all configs (parallel, out-of-tree) run: | .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=47 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ .github/configs/multi-arch.json diff --git a/.github/workflows/multi-compiler.yml b/.github/workflows/multi-compiler.yml index 749689e68f3..e4c7e515cc4 100644 --- a/.github/workflows/multi-compiler.yml +++ b/.github/workflows/multi-compiler.yml @@ -32,7 +32,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 15 + timeout-minutes: 45 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -131,6 +131,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=11 \ + --deadline=18 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ "$RUNNER_TEMP/multi-compiler-configs.json" diff --git a/.github/workflows/net-snmp.yml b/.github/workflows/net-snmp.yml index 78a0a6238a1..9364dbe8095 100644 --- a/.github/workflows/net-snmp.yml +++ b/.github/workflows/net-snmp.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -54,7 +54,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 7 needs: build_wolfssl steps: - name: Download lib diff --git a/.github/workflows/nginx.yml b/.github/workflows/nginx.yml index faa160f6ec3..6c848eb47f8 100644 --- a/.github/workflows/nginx.yml +++ b/.github/workflows/nginx.yml @@ -27,7 +27,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - if: ${{ runner.debug }} name: Enable wolfSSL debug logging diff --git a/.github/workflows/no-malloc.yml b/.github/workflows/no-malloc.yml index 68e31060a81..dc336295457 100644 --- a/.github/workflows/no-malloc.yml +++ b/.github/workflows/no-malloc.yml @@ -32,7 +32,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 10 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -107,6 +107,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ "$RUNNER_TEMP/no-malloc-configs.json" diff --git a/.github/workflows/ntp.yml b/.github/workflows/ntp.yml index fdb99e3b3a9..d9adf1256c8 100644 --- a/.github/workflows/ntp.yml +++ b/.github/workflows/ntp.yml @@ -26,7 +26,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/openldap.yml b/.github/workflows/openldap.yml index e681022b990..aa4a2b36950 100644 --- a/.github/workflows/openldap.yml +++ b/.github/workflows/openldap.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/openresty.yml b/.github/workflows/openresty.yml index d2ed4bd4fc2..15692a586a3 100644 --- a/.github/workflows/openresty.yml +++ b/.github/workflows/openresty.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 5 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/openssh.yml b/.github/workflows/openssh.yml index 663b7997f88..8c2a6e0f1e3 100644 --- a/.github/workflows/openssh.yml +++ b/.github/workflows/openssh.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/openssl-ech.yml b/.github/workflows/openssl-ech.yml index b86167f7506..0da11d1adac 100644 --- a/.github/workflows/openssl-ech.yml +++ b/.github/workflows/openssl-ech.yml @@ -21,7 +21,7 @@ jobs: name: Build wolfSSL if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/opensslcoexist.yml b/.github/workflows/opensslcoexist.yml index 518b5ca168a..037385e3e7c 100644 --- a/.github/workflows/opensslcoexist.yml +++ b/.github/workflows/opensslcoexist.yml @@ -34,7 +34,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 15 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -82,6 +82,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/opensslcoexist-configs.json" diff --git a/.github/workflows/openvpn.yml b/.github/workflows/openvpn.yml index 218a3328480..8e80e2aba44 100644 --- a/.github/workflows/openvpn.yml +++ b/.github/workflows/openvpn.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -51,7 +51,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 10 + timeout-minutes: 15 needs: build_wolfssl steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/os-check.yml b/.github/workflows/os-check.yml index 4d20a39f235..08df0cc038a 100644 --- a/.github/workflows/os-check.yml +++ b/.github/workflows/os-check.yml @@ -162,7 +162,7 @@ jobs: # run is normal whenever the seed has not run recently, and a shard # dying on the timeout would look like a test failure rather than a # cold cache. - timeout-minutes: 60 + timeout-minutes: 105 env: CCACHE_MAXSIZE: 500M # Skip every step of a declined seed so the job shows success. @@ -249,6 +249,8 @@ jobs: if: ${{ env.SEED_DECLINED != 'true' }} run: | .github/scripts/parallel-make-check.py \ + --timeout=21 \ + --deadline=84 \ ${{ (github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.seed != 'false')) && '--build-only' || '' }} \ --shard "${{ matrix.shard }}/${{ strategy.job-total }}" \ --extra-cflags='-pedantic -Wdeclaration-after-statement -Wnull-dereference -Wno-overlength-strings -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE' \ @@ -333,7 +335,7 @@ jobs: runs-on: macos-latest # Serial checks: roughly the sum of the per-config minutes plus # one-time setup, with headroom for a cold ccache. - timeout-minutes: 45 + timeout-minutes: 50 steps: - uses: actions/checkout@v5 @@ -371,6 +373,8 @@ jobs: - name: Build and make check all configs (serial checks, out-of-tree) run: | .github/scripts/parallel-make-check.py \ + --timeout=12 \ + --deadline=45 \ ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.seed != 'false')) && '--build-only' || '' }} \ --threads 1 --cc= \ --extra-cflags='-pedantic -Wdeclaration-after-statement -Wnull-dereference -Wno-overlength-strings -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE' \ diff --git a/.github/workflows/pam-ipmi.yml b/.github/workflows/pam-ipmi.yml index c4daa452ce8..88b7c6e9d87 100644 --- a/.github/workflows/pam-ipmi.yml +++ b/.github/workflows/pam-ipmi.yml @@ -24,7 +24,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/pq-all.yml b/.github/workflows/pq-all.yml index 275bd0d087c..5d68b5e2623 100644 --- a/.github/workflows/pq-all.yml +++ b/.github/workflows/pq-all.yml @@ -48,7 +48,7 @@ jobs: # dependencies" was seen to spend 30 min pulling the cross-compilers from a # slow archive mirror, which used up the whole budget before a single # config built. - timeout-minutes: 45 + timeout-minutes: 100 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -58,10 +58,7 @@ jobs: with: packages: autoconf automake libtool build-essential bubblewrap crossbuild-essential-arm64 crossbuild-essential-armhf qemu-user ghcr-debs-tag: ubuntu-24.04-cross - # Kept for the apt path this no longer normally takes: the default - # budget caps each attempt at 250s and hard-fails a download that - # merely runs slow, and the cross-toolchains are ~118 MB. 1200 gives - # an attempt 500s and still reports inside the 45-minute job. + # The cross-toolchains outgrow the default per-attempt apt limit. budget-seconds: '1200' # ccache via the cross-platform composite; the script passes the @@ -109,6 +106,8 @@ jobs: - name: Build and make check this shard's configs (parallel, out-of-tree) run: | .github/scripts/parallel-make-check.py \ + --timeout=66 \ + --deadline=66 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --shard "${{ matrix.shard }}/${{ strategy.job-total }}" \ --private-dir=certs \ diff --git a/.github/workflows/psk.yml b/.github/workflows/psk.yml index 147f586c3fa..c09b78324a8 100644 --- a/.github/workflows/psk.yml +++ b/.github/workflows/psk.yml @@ -34,7 +34,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 10 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -105,6 +105,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/psk-configs.json" diff --git a/.github/workflows/rng-tools.yml b/.github/workflows/rng-tools.yml index f14877d0124..224d97f2809 100644 --- a/.github/workflows/rng-tools.yml +++ b/.github/workflows/rng-tools.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -53,7 +53,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 7 needs: build_wolfssl steps: - name: Checkout wolfSSL CI actions diff --git a/.github/workflows/rtl8735b.yml b/.github/workflows/rtl8735b.yml index 4d215030a07..97ef94a35db 100644 --- a/.github/workflows/rtl8735b.yml +++ b/.github/workflows/rtl8735b.yml @@ -37,7 +37,7 @@ jobs: name: build + helper KATs (--enable-rtl8735b) if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 15 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -89,6 +89,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py --build-only \ + --timeout=10 \ + --deadline=10 \ "$RUNNER_TEMP/rtl8735b-configs.json" - name: Run helper KATs on host (testwolfcrypt self-test) diff --git a/.github/workflows/silabs-cryptocb.yml b/.github/workflows/silabs-cryptocb.yml index b78b060eff1..ad6383cae81 100644 --- a/.github/workflows/silabs-cryptocb.yml +++ b/.github/workflows/silabs-cryptocb.yml @@ -38,7 +38,7 @@ jobs: name: build + software fall-back (--enable-silabs-cryptocb) if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 20 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -78,6 +78,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py --build-only \ + --timeout=10 \ + --deadline=10 \ "$RUNNER_TEMP/silabs-configs.json" - name: Run testwolfcrypt against a device that declines everything diff --git a/.github/workflows/smallStackSize.yml b/.github/workflows/smallStackSize.yml index dd5236712a0..4deaf84aee1 100644 --- a/.github/workflows/smallStackSize.yml +++ b/.github/workflows/smallStackSize.yml @@ -32,7 +32,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 15 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -88,6 +88,8 @@ jobs: ]} EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ "$RUNNER_TEMP/smallstacksize-configs.json" diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 3825bf20f97..8734bcd5c67 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -166,6 +166,8 @@ jobs: if: steps.merge_check.outputs.skip != 'true' run: | .github/scripts/parallel-make-check.py ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ + --timeout=23 \ + --deadline=30 \ --extra-cflags="-Werror -Wdeclaration-after-statement" \ --private-dir=certs .github/configs/smoke-test.json diff --git a/.github/workflows/socat.yml b/.github/workflows/socat.yml index f5c895b1525..dda73b5a529 100644 --- a/.github/workflows/socat.yml +++ b/.github/workflows/socat.yml @@ -21,7 +21,7 @@ jobs: name: Build wolfSSL if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 @@ -46,7 +46,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # This should be a safe limit for the parallel tests to run. - timeout-minutes: 15 + timeout-minutes: 30 needs: build_wolfssl strategy: fail-fast: false @@ -142,7 +142,7 @@ jobs: cat > socat-configs.json <<'EOF' [{ "name": "socat", "build": false, "netns": true, "shards": __SHARDS__, - "run": [["bash", "-c", "set -e; ip link set lo up || true; sysctl -wq net.ipv6.conf.lo.disable_ipv6=0 || true; ip addr add ::1/128 dev lo || true; ip addr add fc00::1/128 dev lo || true; ip addr add 192.0.2.1/32 dev lo || true; sysctl -wq net.ipv6.bindv6only=0 || true; cp -a \"$SOCAT_SRC/.\" .; grep -q 'fork,retry=2,' test.sh || { echo 'socat test.sh: fork,retry=2 pattern gone, retry-widen would silently no-op (upstream changed?)' >&2; exit 1; }; sed -i 's/fork,retry=2,/fork,retry=30,/' test.sh; tests=$(seq \"$SHARD\" \"$SHARDS\" 999); SOCAT=\"$PWD/socat\" SHELL=/bin/bash timeout -k 10 600 ./test.sh -t 1.0 --expect-fail \"$EXPECT_FAIL\" ${tests:-0}"]] + "run": [["bash", "-c", "set -e; ip link set lo up || true; sysctl -wq net.ipv6.conf.lo.disable_ipv6=0 || true; ip addr add ::1/128 dev lo || true; ip addr add fc00::1/128 dev lo || true; ip addr add 192.0.2.1/32 dev lo || true; sysctl -wq net.ipv6.bindv6only=0 || true; cp -a \"$SOCAT_SRC/.\" .; grep -q 'fork,retry=2,' test.sh || { echo 'socat test.sh: fork,retry=2 pattern gone, retry-widen would silently no-op (upstream changed?)' >&2; exit 1; }; sed -i 's/fork,retry=2,/fork,retry=30,/' test.sh; tests=$(seq \"$SHARD\" \"$SHARDS\" 999); SOCAT=\"$PWD/socat\" SHELL=/bin/bash timeout -k 10 540 ./test.sh -t 1.0 --expect-fail \"$EXPECT_FAIL\" ${tests:-0}"]] }] EOF sed -i "s/__SHARDS__/$(( 6 * $(nproc) ))/" socat-configs.json @@ -151,4 +151,6 @@ jobs: # (mostly waiting), so this just overlaps the waits. fail-fast (the # default) aborts the rest on the first failure. .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ --threads "$(( 2 * $(nproc) ))" socat-configs.json diff --git a/.github/workflows/sssd.yml b/.github/workflows/sssd.yml index 02570f7864d..8be192d1ce6 100644 --- a/.github/workflows/sssd.yml +++ b/.github/workflows/sssd.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/stunnel.yml b/.github/workflows/stunnel.yml index 56ab4f26e93..9121a014f6d 100644 --- a/.github/workflows/stunnel.yml +++ b/.github/workflows/stunnel.yml @@ -23,7 +23,7 @@ jobs: # Just to keep it the same as the testing target runs-on: ubuntu-24.04 # This should be a safe limit for the tests to run. - timeout-minutes: 4 + timeout-minutes: 8 steps: - name: Build wolfSSL uses: wolfSSL/actions-build-autotools-project@v1 diff --git a/.github/workflows/tinytls13.yml b/.github/workflows/tinytls13.yml index 95eb0a82efb..13dd8ded43f 100644 --- a/.github/workflows/tinytls13.yml +++ b/.github/workflows/tinytls13.yml @@ -25,7 +25,7 @@ jobs: name: make check if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 - timeout-minutes: 20 + timeout-minutes: 40 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -133,6 +133,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=15 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/tinytls13-configs.json" diff --git a/.github/workflows/trackmemory.yml b/.github/workflows/trackmemory.yml index 33c097ed2f4..e85b224a36e 100644 --- a/.github/workflows/trackmemory.yml +++ b/.github/workflows/trackmemory.yml @@ -118,6 +118,7 @@ jobs: ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ --timeout=45 \ + --deadline=45 \ "$RUNNER_TEMP/trackmemory-configs.json" - name: ccache stats diff --git a/.github/workflows/wolfCrypt-Wconversion.yml b/.github/workflows/wolfCrypt-Wconversion.yml index 204eda90a48..33592abf400 100644 --- a/.github/workflows/wolfCrypt-Wconversion.yml +++ b/.github/workflows/wolfCrypt-Wconversion.yml @@ -32,7 +32,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 15 + timeout-minutes: 35 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -183,6 +183,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=10 \ + --deadline=10 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ "$RUNNER_TEMP/wconversion-configs.json" diff --git a/.github/workflows/wolfsm.yml b/.github/workflows/wolfsm.yml index f9ba070f808..6a29254f868 100644 --- a/.github/workflows/wolfsm.yml +++ b/.github/workflows/wolfsm.yml @@ -34,7 +34,7 @@ jobs: if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} runs-on: ubuntu-24.04 # Generous for a cold ccache; warm reruns finish in a fraction. - timeout-minutes: 15 + timeout-minutes: 40 steps: - uses: actions/checkout@v5 name: Checkout wolfSSL @@ -109,6 +109,8 @@ jobs: ] EOF .github/scripts/parallel-make-check.py \ + --timeout=12 \ + --deadline=12 \ ${{ github.event_name == 'schedule' && '--build-only' || '' }} \ --private-dir=certs \ "$RUNNER_TEMP/wolfsm-configs.json"