From: Jim Jagielski Date: Mon, 6 Jul 2026 11:52:40 +0000 (+0000) Subject: Merge r1934891 from trunk: X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9407b226af39ed83561aed4c87d4ddcda5fbc747;p=thirdparty%2Fapache%2Fhttpd.git Merge r1934891 from trunk: test/h2: ignore AH02430 for the whole TestRfc9113 class test_h2_203_02 intentionally triggers AH02430 (illegal response header char). Over HTTP/2 the error is logged late during stream teardown and can produce several lines, so the per-case ignore_recent() raced them and they leaked into a later test's check_error_log(). Move the ignore to an autouse class fixture (as conftest.py does for AH10400/AH00045) and add HttpdErrorLog.remove_ignored_lognos() to restore on teardown. Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935937 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/modules/http2/test_203_rfc9113.py b/test/modules/http2/test_203_rfc9113.py index b1a6d02a5d..27bd80b699 100644 --- a/test/modules/http2/test_203_rfc9113.py +++ b/test/modules/http2/test_203_rfc9113.py @@ -12,6 +12,18 @@ class TestRfc9113: def _class_scope(self, env): H2Conf(env).add_vhost_test1().install() assert env.apache_restart() == 0 + # test_h2_203_02 sends a response header with an illegal char on + # purpose; httpd rightly rejects it with AH02430 and RST_STREAMs the + # request. With HTTP/2 that error is emitted *late*, during stream + # teardown, and a single case can produce several AH02430 lines spread + # over time -- so a per-case ignore_recent() races the stragglers, + # which then surface in a later test's check_error_log() (the timing, + # and thus which MPM trips, varies with sync vs async h2 handoff). + # AH02430 is only ever produced here intentionally, so ignore it for + # the whole class; restore the prior set afterwards so it does not leak. + env.httpd_error_log.add_ignored_lognos(['AH02430']) + yield + env.httpd_error_log.remove_ignored_lognos(['AH02430']) # by default, we accept leading/trailing ws in request fields def test_h2_203_01_ws_ignore(self, env): diff --git a/test/pyhttpd/log.py b/test/pyhttpd/log.py index 17b0502e9d..3a0727d2e3 100644 --- a/test/pyhttpd/log.py +++ b/test/pyhttpd/log.py @@ -76,6 +76,10 @@ class HttpdErrorLog: for l in lognos: self._ignored_lognos.add(l) + def remove_ignored_lognos(self, lognos: List[str]): + for l in lognos: + self._ignored_lognos.discard(l) + def _is_ignored(self, line: str) -> bool: if self._lookup_matches(line, self._ignored_matches): return True