Repository navigation
Backport Uranium tests to 9.2.x - #13892
Conversation
bryancall
left a comment
There was a problem hiding this comment.
❌ Request changes
I reviewed a064c5af0f..1fc2052d63 (5 commits, 1696 files, +72022/-50151). On eris I built the merge-base and the head in the CI Fedora 44 image, ran the full Uranium suite, the merge-base AuTest suite, the CI Format and RAT steps, and targeted mutations. The two newest commits touch no C++, so the head build stands. Most of the conversion holds up: every 9.2.x AuTest but one has a replacement, and the client certificate fix matches #13576 and goes red without it. Three things need to change.
Fixed: Format and RAT
a9eb20b003 writes tests/urtest-configured.sh for in-tree builds, so the tracked launcher survives ./configure and git diff is clean after make clang-format. make rat now reports only my worktree's .git file, which a normal clone does not have.
Fixed: nested sandboxes in test_plugin.py
At 1fc2052d63, test_plugin.py passes 10 of 10 in three runs with ATS_URTEST_SANDBOX set the way CI sets it, and once with --sandbox instead.
Still blocking: HTTP/2 SSN_CLOSE hooks get an uninitialized client address
Still present at 1fc2052d63. proxy/http2/Http2ClientSession.cc:49 now nulls _vc before TS_HTTP_SSN_CLOSE_HOOK. After that, get_remote_addr() and get_local_addr() (:271, :277) return cached_client_addr and cached_local_addr, which nothing on 9.2.x ever writes. With a probe plugin logging TSHttpSsnClientAddrGet, every HTTP/2 SSN_CLOSE showed 127.0.0.1 with the real port at the merge-base (traffic_server 86888cd3a9d06fdc) and family=44510 at the head (947fab0cf0b61a17). Assigning both cached addresses in destroy() before _vc->do_io_close() should fix it. Master has the same latent bug.
What would change my mind: a 9.2.x path that fills cached_client_addr, or the probe showing a real address at your head.
Still blocking: replay expectations that nothing checks
Still present at 1fc2052d63. Proxy Verifier runs without --strict (tests/tools/uranium/replay.py:190, :374), so a plain url:, header or content: value with no verify rule is never compared.
pluginTest/cookie_remap/cookie_remap.test.yaml:137routes byproxy-request: {url: /cookieexists}. I flippedNOTEXISTStoEXISTSatplugins/experimental/cookie_remap/cookie_remap.cc:605.cookie_remap-cookie-existsstill passed (cookie_remap.soc161b5248a2ab989), and its sandbox shows both requests went to/cookiedoesntexist. The same mutation fails the oldexistscookieAuTest (7d05d1c39ef979cd). Both pass when restored.pluginTest/lua/lua_api.test.yaml:206expectsdefault foo ts_lua, but onlyts_luais enabled (:29), and the test passes anyway.:145and:217have the same problem.- The 9.2.x-only
pluginTest/header_rewrite/header_rewrite.test.pyhas no replacement. Itsrule.confand gold files were copied, but no collected test uses them.
What would change my mind: the cookie_remap mutation failing at your head.
Still blocking: TLS 1.3 is never disabled
Still present at 1fc2052d63. tls_hooks/test_tls_hooks.py:53 and :222, pluginTest/traffic_dump/test_traffic_dump.py:76, test_traffic_dump_sni_filter.py:66 and test_traffic_dump_response_body.py:71 set proxy.config.ssl.TLSv1_3.enabled, the 10.x name. 9.2.x reads proxy.config.ssl.TLSv1_3 (mgmt/RecordsConfig.cc:1145). diags.log logs "Unrecognized configuration value", and traffic_dump recorded six TLSv1.3 sessions.
What would change my mind: these tests showing TLS 1.2 with proxy.config.ssl.TLSv1_3: 0.
Verified: suite results
At the head: 626 passed, 3 failed, 11 skipped. Two failures were the collision tests fixed above. The third, http2_flow_control-small-window, also fails in the old AuTest at the merge-base. At the merge-base, AuTest (4 shards) gave 318 passed, 8 failed, 7 skipped; the Uranium versions of the other seven failures pass. The skips match apart from four master-only tests.
Non-blocking
test_tls_hooks.py:89-110swaps three gold files for substrings, and the "appears only once" checks are gone.logging/test_sigusr2.pyno longer checks manager.log rotation.cache/replay/cache-control-basic.test.yaml:195-211runsonly-if-cachedagainst a URL it never fetched.tls/test_tls_client_verify.pydropped thebob.*.comand*bar.comwildcard patterns.iocore/net/P_SSLSecret.h:40namesTS_LIFECYCLE_SSL_SECRET_HOOK, which 9.2.x lacks.- Master-only leftovers:
pluginTest/txn_box/**,tls/test_tls_engine_abort.py, theCMakeLists.txtfiles undertests/uranium_tests/,runner.py:436, and Cripts inuranium-tests.en.rst. ci/jenkins/bin/autest.shandci/regressionstill call the deleted AuTest runner.
HTTP/2 peer shutdown can deliver VC_EVENT_EOS while a session-close hook waits for its mutex. The API callback handler rejects that network event and aborts the proxy. Running the converted Uranium lifecycle test repeatedly exposed this pre-existing 9.2 production race. This patch applies the socket close ordering already used by master (apache#9366), closing network I/O before invoking session-close hooks. It caches both socket endpoints first so close-hook address APIs retain valid addresses and ports after the connection is released. The converted lifecycle tests check hook ordering and endpoint preservation. Co-authored-by: GPT-6 Astra Medium
The converted cert_update test exposes an existing 9.2 production bug: TSSslClientCertUpdate searches with a certificate-and-key pair although the context map uses the certificate path. The original AuTest reported false success because its lowercase Streams.all assignments registered no assertions, so certificate replacement failures went unnoticed. This patch backports the fix from apache#13576, updating every matching CA bucket, invalidating cached certificate data, preserving live contexts on replacement failure, and releasing the acquired SSL configuration. The separate Uranium migration verifies certificate subjects before and after replacement and retains the working context after an invalid PEM. This production prerequisite lets that coverage run without hiding the defect behind a skip or an expected failure. Co-authored-by: GPT-6 Astra Medium
1fc2052 to
ce401e2
Compare
|
Addressed the review in ce401e2, folded into the existing prerequisite/migration commits:
Validation: final related suite 79 passed, 1 skipped (-n 4); the restored priority test and expanded cache-control replay then both passed. Framework: 119 passed. Build/install, make -j8 format, Sphinx docs, and distribution packaging passed. RAT on the staged source archive reported 0 unknown licenses. No assertions were replaced with skips or expected failures. Thank you for the detailed independent checks and mutation tests. |
bryancall
left a comment
There was a problem hiding this comment.
❌ Request changes
I re-reviewed what changed between 1fc2052d63 and ce401e2c5e (86 files, +676/-2571), using git range-diff to see which of the five commits each fix went into. Your three blocking fixes look right, and so do all the non-blocking ones. Two new blockers came up, and the first one is my fault.
Fixed: HTTP/2 SSN_CLOSE addresses
destroy() now copies both endpoints before do_io_close() (proxy/http2/Http2ClientSession.cc:50-51). That is the only place this class nulls _vc. In --check-addresses mode, ssntxnorder_verify compares numeric endpoints between SSN_START and SSN_CLOSE and aborts on a bad family or a zero port. test_continuations.py then requires ssn.addresses == ssn.close for h2. I read this but did not rerun your revert this round.
Fixed: replay expectations nothing checks
- cookie_remap now checks path and query on every routed request, and the two collapse cases check the origin's request line.
- lua_api now has
verifyrules on its bodies, and the debug-tags case enablesfoo|ts_lua. header_rewrite_status.test.yamltakes over from the global 303 test.- The new guard in
tests/tools/uranium/tests/test_replay.pydoes its job. When I turned one cookie_remap rule back intourl: /cookieexists, it failed; restoring the rule made it pass.
Fixed: TLS 1.3 disable
All five tests now use proxy.config.ssl.TLSv1_3 (mgmt/RecordsConfig.cc:1145), and no .enabled name is left. tls_hooks requires curl to report TLSv1.2 and not TLSv1.3. traffic_dump checks version:TLSv1.2, which comes from SSL_get_version().
Fixed: non-blocking items
- tls_hooks has its gold files and count checks back.
- sigusr2 checks manager.log rotation again.
- cache-control-basic runs the only-if-cached request in the right sequence.
- The
bob.*.comand*bar.compatterns match the AuTest again. - The
P_SSLSecret.hcomment is corrected. - The txn_box, CMake,
runner.pyand Cripts leftovers are gone. - The in-repo CI runners are updated.
Still blocking: engine-abort coverage is gone (my mistake)
Last round I listed tls/test_tls_engine_abort.py as a master-only leftover. That was wrong, and I sent you the wrong way.
tests/gold_tests/tls/tls_engine_abort.test.pyis a 9.2.x AuTest at the merge-base. It guards 2eab8d0, "SSLNetVConnection: deregister async handshake eventfd on connection teardown", which is on 9.2.x.- The Uranium port only looked master-only because it loaded
async_handshake.so. 9.2.x does not build that plugin, so the port always skipped. - With the port deleted, nothing on this branch runs that fix.
Everything the AuTest used is already here:
async_engine.so(tests/tools/plugins/Makefile.inc:89)- the
load_engine.cnfsetup intest_tls_engine.py - the abort client
tls/tls_engine_abort.py, which is now orphaned
What would change my mind: a port that checks what the AuTest checked. That is 30 aborted handshakes, a normal request that succeeds afterwards, and Send signal to in traffic.out with no AddressSanitizer output.
Still blocking: make dist on a clean checkout
tests/uranium_dist.inc:721 lists uranium_tests/pluginTest/origin_server_auth/gold, which is not in the tree. origin_server_auth is the 10.x name; 9.2.x has s3_auth. automake makes every EXTRA_DIST entry a prerequisite of distdir-am, so a missing one stops with "No rule to make target". I confirmed that with a small automake 1.18.1 project on eris; I did not run make dist on this tree. Every other entry in the file exists. The line was already in 1fc2052d63 and I missed it. Your packaging run passed, so it may be worth checking whether that directory exists in your checkout.
Blocking: AuTest is red on three of four shards
On this branch autest.pipeline runs the whole Uranium suite in every shard (urtest.sh -v -n 2, no slicing). That makes it three of four full runs failing at ce401e2c5e, against one of four at 1fc2052d63. The consoles need a login, so I can't see which tests failed. Could you post the failing test names?
Non-blocking
- Guard scope. The guard only scans
*.test.yaml. One replay file outside that glob is live:h2/replay_h2_origin_cert_reverify.yaml, whichh2_origin_cert_reverify.test.yamluses. It still has a bareurl: /fooand Host. Asserting that the glob matched something would also stop the guard passing on nothing if the paths move. - null_transform. The origin in
null_transform.test.yamlnow sendsContent-Length: 26itself, so the Content-Length check on the proxy response is a passthrough. The AuTest origin sent no length, so its gold showed ATS setting one. - prefetch.
prefetch_query_path_traversal.test.yaml:124checksX-CDN-Prefetch, but the plugin sendsX-AppleCDN-Prefetch(plugins/prefetch/configs.h:38). It came from the AuTest, and your newlog_validationat:31is the real check, so the rule can go. - HTTP/2-to-origin leftovers. No test uses
h2/replay_h2origin/,replay_h2o_continuation/,replay_h2o_safe_retry/,safe_retry_origin.py,continuation_origin.py,h2_interim_origin.py,h2_large_header_origin.py,h1_trailer_client.py,h2_origin_trailers_h1.replay.yamlorh2o_connection_close.conf.tests/serial_tests.txt:21namesh2/test_h2_to_origin_safe_retry.py, which does not exist. - Jenkins Proxy Verifier.
ci/jenkins/bin/autest.shpasses--proxy-verifier-binonly to pytest.run_configured()checks its own configured path first (tests/tools/uranium/runner.py:139), so the job downloads Proxy Verifier unlessPROXY_VERIFIER_PATHis exported.
The supported 9.2 branch still depends on AuTest after master moved to pytest-based Uranium. Maintaining separate test frameworks makes new regressions harder to backport and leaves branch-specific coverage dependent on the old runner. This patch migrates the existing scenarios to self-contained replay tests and fixture-driven pytest functions while preserving 9.2 behavior. The shared harness supports Autotools, records.config, and managed configuration reloads, with API documentation and source-distribution assets. The configured wrapper also includes the Bash 3 empty-array fix from apache#13884. Two separate production prerequisites fix defects exposed by the tests. The socket-close ordering fix from apache#9366 prevents HTTP/2 network events from reaching a pending session-close hook and aborting the proxy. The client-certificate update fix from apache#13576 corrects context lookup and replacement; the old AuTest's unregistered output assertions had hidden its failure. These fixes let the converted tests retain their intended coverage rather than skipping or accepting the broken behavior. Co-authored-by: GPT-6 Astra Medium
ce401e2 to
f11fe0f
Compare
|
Thanks for the additional review. The migration commit now restores the 9.2 asynchronous-engine abort test: thirty abandoned handshakes must produce an engine wakeup before a subsequent healthy request succeeds, and the test rejects AddressSanitizer output. The null-transform test now uses a close-delimited origin response without Content-Length and checks the synthesized length against the original gold file. The replay guard now follows external server/client YAML and rejects an empty manifest inventory; the live origin-certificate replay has explicit path and Host verification. I also removed the inactive prefetch-header assertion and confirmed-unused HTTP/2-origin assets, exported PROXY_VERIFIER_PATH for Jenkins, and corrected the distribution inventory with a regression check for missing or untracked sources. Validation: 46 focused tests passed, the final strengthened engine-abort test passed separately, all 120 framework tests passed, and the tests distribution target passed. These are local results, not a claim that Jenkins is green: the earlier Jenkins builds 45950, 45951, and 45953 now return 404, so their original failures could not be inspected. The PR description's literal newline escapes are also corrected. |
|
The corresponding master corrections are now in #13914. Shared assertion and lifecycle fixes were adapted to master rather than copying branch-specific behavior: master retains its asynchronous-handshake plugin, current TLS configuration names, and HTTP/2-to-origin semantics. The new master close-hook regression also covers the effective PROXY-protocol client address. |
* Preserve HTTP/2 addresses through close hooks HTTP/2 session destruction closes its network connection before invoking session-close hooks. The session address APIs then return null or stale endpoints, preventing plugins from inspecting the completed connection. This patch caches both socket endpoints and the effective client address before closing the connection. The close-hook regression compares the numeric addresses and ports with their session-start values, including the effective address supplied through PROXY protocol. Co-authored-by: GPT-6 Astra Medium * Restore Uranium coverage found in backport review Review of the Uranium backports (#13889 and #13892) found gaps on master: some replay values did not enable verification, and some converted tests no longer exercised the original body, framing, or lifecycle assertions. Leaving those corrections only on release branches would make master less thoroughly tested than the supported releases. This patch restores explicit replay assertions and original protocol semantics, including independent Lua client sessions, length synthesis, complete large-response checksums, and TLS hook counts. A focused guard protects the audited manifests and their external replay dependencies. The accompanying HTTP/2 production fix preserves addresses during session-close hooks. The strengthened continuation regression exposed that shared issue, so this PR includes the fix as well as the tests. Co-authored-by: GPT-6 Astra Medium ---------
986cca5 to
d1ad18e
Compare
bryancall
left a comment
There was a problem hiding this comment.
❌ Request changes
I re-reviewed ce401e2c5e..d1ad18e609 with git range-diff on merge-base a064c5af0f: 26 files, +290/-2521. On hera I built with gcc ASAN, ran the touched tests, mutated 2eab8d0, and ran the tests/ distdir in-tree and VPATH. The ASAN and HTTP/2 files are unchanged since 986cca52e9.
Fixed: missing dist entry
make distdir in tests/ fails at ce401e2c5e on origin_server_auth/gold and passes at d1ad18e609. Top-level make dist stops earlier on Http2FequencyCounter.h (proxy/http2/Makefile.am:112), broken at the merge-base too.
Fixed: engine-abort port
tls/test_tls_engine_abort.py checks what the AuTest checked, and the wait at :47 needs a completion from the barrage itself.
Fixed: last round's non-blocking items
Replay guard, prefetch rule, HTTP/2 leftovers and PROXY_VERIFIER_PATH are all done.
Still blocking: in-tree dist ships the configured launcher
Still present at d1ad18e609. The new dist-hook (tests/Makefile.am:55-56) works for VPATH. In-tree, after configure, distdir runs config.status tests/urtest.sh because urtest.sh is in EXTRA_DIST (:51). That overwrites the tracked launcher, so the hook copies the wrapper onto itself. The tarball gets --install-prefix=/usr/local and git status shows M tests/urtest.sh. In-tree make distclean also deletes it (CONFIG_CLEAN_FILES). The new runner test only covers a pristine srcdir.
What would change my mind: an in-tree configure; make dist that leaves git status clean and ships the tracked urtest.sh.
Verified: the HTTP/2 change fixes a real race
The previous test and client failed 5 of 8 runs, always cl-negative logging 0x05 ... recv data stream closed: ATS rejects the length and closes the stream before the queued DATA arrives, as RFC 9113 says. The new version passed 5 of 5. The allowance covers only cl-negative and that message.
Non-blocking
- The port can't pass under ASAN.
tests/tools/plugins/async_engine.c:177-178frees the write fd and then prints it, so ASAN stops traffic_server inwait_cleanup(3 of 3). The bug predates this PR, but please pick the three-line hunk from #13013 into this backport. With it the port passed 3 of 3. - No test catches a 2eab8d0 regression. With both
async_ep.stop()calls removed (traffic_server5df368baabb39291), the port passed 3 of 3, and passes restored (5116c1372f71d6bd). Every job resumes before Cleanup, so no connection is freed mid-job. The AuTest shares the client and engine (not run), so this gap is mine. test_replay.py:147resolvespathbut nottest_root(:141), so:162raises ValueError under a symlinked checkout.- microserver adds
Content-Lengthitself, so null_transform can't prove ATS computes it; my last note was wrong.
In-source configuration overwrote the tracked Uranium launcher, causing CI's formatting clean-tree check to fail. RAT also treated the generated Python dependency lockfile as an unlicensed source file. This patch preserves the source launcher and delegates configured runs to a separate generated wrapper, with regression coverage for argument forwarding. It also includes the launcher in source distributions and excludes the generated lockfile from license scanning. Co-authored-by: GPT-6 Astra Medium
An exported sandbox path makes the collision-diagnostic self-test reuse the enclosing pytest session's locked sandbox, preventing the intended collection diagnostic from running. This patch gives the child session an explicit private sandbox and exercises both serial and parallel collection with an inherited, locked parent sandbox. The shared-sandbox safety lock remains unchanged. Co-authored-by: GPT-6 Astra Medium
Malformed HTTP/2 requests can race connection shutdown before the client finishes writing. On 9.2, rejecting negative Content-Length headers can also legitimately close a stream before queued DATA arrives. This patch brings in the client synchronization from apache#13914 and isolates validation cases so the expected closed-stream diagnostic is allowed only for the negative-length rejection. Valid requests still reject all error diagnostics, and malformed cases retain their rejection checks. Co-authored-by: GPT-6 Astra Medium
d1ad18e to
64d94be
Compare
|
Thanks for the detailed re-review. Updated in 64d94be (folded into the existing commits).
Validation: Autotools ASAN build/install and make -j8 format succeeded; all 124 framework tests passed. The TLS engine, TLS engine abort, and null-transform tests passed under ASAN, with two additional successful abort runs (3/3 total). I agree the inherited abort client does not deterministically exercise teardown while an async job is pending. I corrected its misleading documentation, but have not closed that coverage gap or weakened its existing assertions. A passing abort run must not be treated as proof that removing async_ep.stop() is caught. The previously verified HTTP/2 synchronization is unchanged. |
|
[approve ci autest 3] |
bryancall
left a comment
There was a problem hiding this comment.
✅ Approve
Thanks for chasing this one all the way down.
Fixed: in-tree dist keeps the tracked launcher
On hera, a plain in-tree ./configure followed by make -C tests distdir leaves git status clean and ships tests/urtest.sh byte for byte. make -C tests distclean leaves the launcher in place. At d1ad18e609 the same steps gave M tests/urtest.sh, then D tests/urtest.sh. Out of tree is clean too, and make urtest hands off to urtest-configured.sh in both layouts. The new autotools regression fails in-tree on the old scheme and passes now.
Fixed: last round's non-blocking items
The async_engine.c hunk matches #13013. The symlinked-checkout test fails without the new .resolve() and passes with it. The null_transform description is corrected.
Non-blocking
distclean-local(tests/Makefile.am:58) and the launcher copy (configure.ac:2397) compare path strings, not files. On hera, configuring in-tree through a symlink to the same directory made configure printcp: ... are the same file, andmake distcleanthen deleted the trackedtests/urtest.sh./tmpand/private/tmpon macOS hit this without trying. A-eftest in both places would close it.- A failed
cp -pin that configure command doesn't fail configure, so an unwritable staletests/urtest.shstays in place without an error. tls_engine_abort.py:41-42and:48still say the close lands inside the engine's pause, which the new docstring says the test can't establish.uranium-tests.en.rst:159andtests/README.md:32still say<build>/tests/urtest.shrecords the build paths. That'surtest-configured.shnow.
The supported 9.2 branch still depends on AuTest after master moved to
pytest-based Uranium. Maintaining separate test frameworks makes new
regressions harder to backport and leaves branch-specific coverage
dependent on the old runner.
This patch migrates the existing scenarios to self-contained replay
tests and fixture-driven pytest functions while preserving 9.2 behavior.
The shared harness supports Autotools, records.config, and managed
configuration reloads, with API documentation and source-distribution
assets. The configured wrapper also includes the Bash 3 empty-array fix
from #13884.
Two separate production prerequisites fix defects exposed by the tests.
The socket-close ordering fix from #9366 prevents HTTP/2 network events
from reaching a pending session-close hook and aborting the proxy. It
preserves both socket endpoints before closing so session-close hooks can
still query valid client and local addresses. The client-certificate update fix from #13576 corrects context lookup and
replacement; the old AuTest's unregistered output assertions had hidden
its failure. These fixes let the converted tests retain their intended
coverage rather than skipping or accepting the broken behavior.
Co-authored-by: GPT-6 Astra Medium