From f0a737832c9d6319367c27a7c20448d7aee12a7d Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Thu, 19 Nov 2026 20:20:48 -0800 Subject: [PATCH] test: scale the cert-scripts subprocess timeout for emulated (non-x86) builds With python:3.12-slim now a real multi-arch index, the arm64 leg really runs the image gate under QEMU (~30x slower). test-cert-scripts.py took 229 s there and its 200-iteration bash loop exceeded a flat 120 s timeout (CI run 5756), and the whole arm64 step then hit its 30-minute ceiling (run 5758). x86 keeps 120 s; other machines get 900 s. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6 --- scripts/test-cert-scripts.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/test-cert-scripts.py b/scripts/test-cert-scripts.py index 2bf412f..d4f4473 100755 --- a/scripts/test-cert-scripts.py +++ b/scripts/test-cert-scripts.py @@ -54,6 +54,7 @@ destructive there; see _cleanup_tmp(). """ import os +import platform import re import shutil import stat @@ -63,6 +64,12 @@ import textwrap import time import unittest +# Subprocess ceiling. The arm64 image gate runs under QEMU (~30x slower: this +# file took 8 s natively and 229 s emulated, and the 200-iteration bash loop in +# test_validation_of_a_live_pem_being_republished_is_not_spurious then exceeded +# a flat 120 s, failing the arm64 leg of every build). Native x86 keeps 120 s. +SUBPROCESS_TIMEOUT = 120 if platform.machine() in ('x86_64', 'AMD64') else 900 + MODULE_DIR = os.path.abspath( os.environ.get('HAPROXY_MANAGER_DIR', os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) @@ -379,7 +386,7 @@ class CertScriptFixture(unittest.TestCase): path = os.path.join(SCRIPTS_DIR, name) self.assertTrue(os.path.exists(path), f'{path} does not exist') return subprocess.run(['bash', path], env=self.env(**env_overrides), - capture_output=True, text=True, timeout=120) + capture_output=True, text=True, timeout=SUBPROCESS_TIMEOUT) def bundle_is_valid(self, path): """Ask the shipped library whether HAProxy could use this bundle.""" @@ -964,7 +971,7 @@ class TestCertPublishLibrary(CertScriptFixture): ['bash', '-c', '. "$1"; for i in $(seq 1 200); do cert_bundle_valid "$2" || exit 1; done', '_', LIB, self.live_pem], - env=self.env(), capture_output=True, text=True, timeout=120) + env=self.env(), capture_output=True, text=True, timeout=SUBPROCESS_TIMEOUT) _stop() output = result.stdout + result.stderr