]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
test/h2: ignore AH02430 for the whole TestRfc9113 class
authorJim Jagielski <jim@apache.org>
Tue, 2 Jun 2026 15:50:29 +0000 (15:50 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 2 Jun 2026 15:50:29 +0000 (15:50 +0000)
  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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934891 13f79535-47bb-0310-9956-ffa450edef68

test/modules/http2/test_203_rfc9113.py
test/pyhttpd/log.py

index b1a6d02a5de87007401c57fb6dcf8d579876c548..27bd80b6990dfb249ac886237fdc836f6c41ba89 100644 (file)
@@ -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):
index 17b0502e9dee5b88a6b4f0279e62dc4d63da8fa8..3a0727d2e3c7dab6dc7531b634f06a6f3f0e5871 100644 (file)
@@ -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