From 06af956079749abe7a1ab34fb95ca072ef366304 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 16 Sep 2026 19:09:09 +0100 Subject: [PATCH 1/2] * test/pyhttpd/env.py (apache_fail): Check the exit code of the "start" result rather than comparing the ExecResult to 0, which never matched, so a started server was never waited for and could race with the next test. Co-Authored-By: Claude Opus 5 (1M context) --- test/pyhttpd/env.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/pyhttpd/env.py b/test/pyhttpd/env.py index 02d82ecae25..47926d66301 100644 --- a/test/pyhttpd/env.py +++ b/test/pyhttpd/env.py @@ -1009,12 +1009,10 @@ def apache_fail(self): rv = self._win_start() return 0 if rv != 0 else (0 if self.is_dead() else -1) self._run_apachectl("stop") - rv = self._run_apachectl("start") - if rv == 0: - rv = 0 if self.is_dead() else -1 - else: - rv = 0 - return rv + r = self._run_apachectl("start") + if r.exit_code == 0: + return 0 if self.is_dead() else -1 + return 0 def apache_hard_restart(self) -> int: """Restart without the "graceful" flag, so the MPM starts over.""" From d39250a3833394c21e5e25e768cacc8a0d74c789 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 16 Sep 2026 19:43:30 +0100 Subject: [PATCH 2/2] * test/modules/md/test_300_conf_validate.py (test_md_300_011a, test_md_300_021): Expect the server to start, since an unmanaged vhost name only logs a warning; this was hidden by the broken apache_fail() check. Co-Authored-By: Claude Opus 5 (1M context) --- test/modules/md/test_300_conf_validate.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/modules/md/test_300_conf_validate.py b/test/modules/md/test_300_conf_validate.py index dc65aa20690..7d5835c0674 100644 --- a/test/modules/md/test_300_conf_validate.py +++ b/test/modules/md/test_300_conf_validate.py @@ -204,8 +204,7 @@ def test_md_300_011a(self, env): "not-forbidden.org", "test3.not-forbidden.org", "test4.not-forbidden.org" ]) conf.install() - assert env.apache_fail() == 0 - env.apache_stop() + assert env.apache_restart() == 0, f'{env.apachectl_stderr}' env.httpd_error_log.ignore_recent([ "AH10040" # A requested MD certificate will not match ServerName ]) @@ -344,13 +343,13 @@ def test_md_300_021(self, env): "not.secret.com", "secret.com" ]) conf.install() - assert env.apache_fail() == 0 - # this is unreliable on debian - #assert env.httpd_error_log.scan_recent( - # re.compile(r'.*Virtual Host not.secret.com:0 matches Managed Domain \'secret.com\', ' - # 'but the name/alias not.secret.com itself is not managed. A requested ' - # 'MD certificate will not match ServerName.*'), timeout=10 - #) + assert env.apache_restart() == 0, f'{env.apachectl_stderr}' + env.httpd_error_log.ignore_recent( + lognos = [ + "AH10040", # A requested MD certificate will not match ServerName + "AH10105" # MD secret.com does not match any VirtualHost with 'SSLEngine on' + ] + ) # test case: use MDRequireHttps in an construct, but not in