Skip to content

urtest: Convert AuTest tests to pytest - #13545

Merged
bryancall merged 33 commits into
apache:masterfrom
bneradt:pytest-replay-tests
Oct 21, 2026
Merged

bryancall merged 33 commits into
apache:masterfrom
bneradt:pytest-replay-tests

Conversation

@bneradt

@bneradt bneradt commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

This replaces Traffic Server's AuTest end-to-end suite with Uranium, a pytest
test framework for Proxy Verifier replays and native Python scenarios. There is
no AuTest compatibility backend in the resulting test suite.

Summary

  • make pytest own the ATS end-to-end test inventory
  • collect direct Proxy Verifier manifests named <scenario>.test.yaml; each
    manifest contains both its urtest configuration and replay sessions
  • express tests that need custom clients, servers, or control flow as native
    pytest scenario classes with an explicit run() entry point
  • schedule parallel work through pytest-xdist while isolating sandboxes, ports,
    and shared/exclusive scenarios
  • provide shared ATS, origin, DNS, curl, process, replay, and gold-file helpers
    under tests/tools/uranium
  • replace AuTest entry points and configuration with urtest.sh, Uranium CMake
    options and targets, and urtest replay metadata

Direct replay manifests live in an existing replay/ or replays/ directory
when a test tree has one. The at_headers manifest intentionally remains next
to its plugin assets.

Developer workflow

Run selected tests with pytest's normal selection and parallelism options:

./tests/urtest.sh -q -k cache_control
./tests/urtest.sh -q -n 8 -k "header_rewrite or cache_control"

A configured tree generates <build>/tests/urtest.sh for running against its
installed ATS tree. Manual tests are skipped by default and can be selected
explicitly with --run-manual -k <expression>.

Container behavior

The source-tree runner defaults to
ci.trafficserver.apache.org/ats/fedora:44, performs an incremental dedicated
build/install, and runs pytest there. It avoids nested Docker whenever it is
already inside any container. --run-in-docker and --no-run-in-docker
override that choice.

The official Fedora image also enables the optional cdifflib acceleration for
large gold-file comparisons. Other environments use it when installed and
fall back to the standard-library difflib implementation otherwise.

Compatibility

This is an intentional cutover rather than a deprecation shim. The AuTest
runner, backend, CMake targets, presets, and options are removed. CMake reports
a fatal migration message if removed ENABLE_AUTEST, ENABLE_AUTEST_UDS,
AUTEST_SANDBOX, AUTEST_OPTIONS, or PYTEST_OPTIONS variables are supplied.
Existing CI scripts now invoke Uranium and pass pytest's -k and -n options.

SHARD and SHARDCNT continue to distribute pytest items across CI shards.

Validation

  • Fedora 44 build and install completed successfully
  • all 371 direct replay variants: 356 passed and 15 capability skips
  • 51 Uranium framework unit tests passed
  • the converted client-certificate update scenario reaches its strict expected
    failure for the pre-existing TSSslClientCertUpdate defect
  • Sphinx documentation completed with warnings treated as errors
  • replay manifests parsed and all referenced client/server replay files exist
  • Python static checks, CI shell syntax checks, formatting, and whitespace
    checks passed

@bneradt bneradt added this to the 11.0.0 milestone Aug 13, 2026
Copilot AI lite review requested due to automatic review settings August 13, 2026 18:34
@bneradt bneradt self-assigned this Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bneradt
bneradt marked this pull request as draft August 13, 2026 18:37
@bneradt bneradt changed the title Add pytest replay test framework Unify end-to-end tests under pytest Aug 13, 2026
@bneradt bneradt changed the title Unify end-to-end tests under pytest urtest: Convert AuTest tests to pytest Aug 14, 2026
@bneradt
bneradt force-pushed the pytest-replay-tests branch from 1b8339e to 678cb46 Compare August 14, 2026 17:29
@brbzull0
brbzull0 requested a lite review from Copilot August 17, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@bryancall bryancall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as a comment rather than a formal review since it is still a draft. There is a lot of good work here, and two things that I think need to come out of this PR before it goes further.

First the good, because the framework itself is well built:

  • Replay manifests are collected as first-class pytest items, so each scenario gets its own result and sandbox instead of hiding behind a thin registration wrapper.
  • Validation parity with AuTest is preserved rather than quietly dropped. diags.log is still scanned for ERROR:, FATAL: and unrecognized configuration values, background processes are checked for premature exit, and _validate_gold reproduces the {} and backtick wildcard semantics of the old matcher.
  • Cross-worker port allocation uses a flock'd counter plus a bind probe, which is a genuine improvement over a per-process allocator.
  • Sandbox paths are deliberately short and hashed with the rationale tied to sockaddr_un.sun_path's 108-character limit written down, and prepare_sandbox refuses to rmtree anything that is not a direct child of the sandbox root.
  • The consolidation is real rather than lossy, and the framework ships its own unit tests instead of being validated only by the suite it runs.

Two production changes are buried in the test migration

This is my main concern and it is a process point rather than a code-quality one. Copilot declined to analyze this PR because it exceeds its file limit, so these two changes have had no automated review either, and at 2414 files no human is going to find them by reading.

src/api/InkAPI.cc:8240 TSSslClientCertUpdate()'s lookup key changes from swoc::bwprint("{}:{}", cert_path, key_path) to key.assign(cert_path).

I traced this rather than assuming. The inner map is keyed by certificate path alone: SSLConfig.cc:952 sets ctx_key = client_cert, and the only producer of that key, SSLSNIConfig.cc:185, stores a fully resolved absolute path, which is what the cert_update plugin passes via traffic_ctl plugin msg. So on master the composed cert:key string can never match, the API always falls through and returns TS_ERROR without touching anything. After this change it locates the bucket, calls SSLCreateClientContext and swaps the shared context under ctxMapLock.

That is a dead-to-live transition on a public TSAPI affecting shared outbound TLS state. The fix looks correct to me. The problem is that its only covering test, cert_update.test.py, is deleted and rewritten in the same commit range, so a green run cannot distinguish "the API fix works" from "the rewritten test no longer asserts the same thing". This needs to land in its own PR against an unmodified test.

src/proxy/http/HttpTransact.cc:6399-6410 A new proxy.config.http.cache.max_stale_age_percent record, added end to end: RecordsConfig.cc:663, HttpConfig.h:708, OverridableConfigDefs.h:255, a new TS_CONFIG_HTTP_CACHE_MAX_STALE_AGE_PERCENT inserted before TS_CONFIG_LAST_ENTRY in apidefs.h.in:921, cripts/Configs.hpp:104, and the clamp logic in is_stale_cache_response_returnable(). None of it exists on the base and none of the seven commit messages or the PR body mention it.

In fairness: the default is 0 and the arithmetic collapses to the exact master expression at 0, so no behavior change ships. It is still a new proxy.config.* record and a new TSOverridableConfigKey, which is API surface the project supports forever, and it touches the stale-serving threshold used by negative revalidating and open_write_fail_action, which is load-shedding-critical.

One substantive note on the logic itself if it does get its own PR: get_max_age() returns 0, not -1, when a max-age directive is present but zero. So with the percent knob enabled, max_stale_age becomes 0 and any nonzero age fails the returnability test. An origin sending Cache-Control: max-age=0, which is common in front of revalidating origins, stops being served stale entirely during an outage. The documentation covers the absent case but not the present-and-zero case.

The Jenkins entry point is left in a non-working state

ci/jenkins/bin/autest.sh:123

The entire change to this file is one line, -D ./tests/gold_tests to -D ./tests/uranium_tests. Lines 107-108 still resolve AUTEST=/usr/bin/autest and line 123 still executes it. I counted the new tree: tests/uranium_tests has 0 files matching *.test.py, which is AuTest's only collection pattern, against 233 *.test.yaml and 303 test_*.py, and tests/gold_tests no longer exists. tests/pyproject.toml also drops the autest dependency.

So this script either runs a discovery pass over an inventory it cannot see and reports green having executed nothing, or fails for a reason unrelated to the change under test. ci/coverage and ci/regression were correctly updated to call tests/urtest.sh; this one was missed. A CI job that silently runs zero tests is worse than one that fails.

The deprecation story does not hold

CMakeLists.txt:164-165

The PR body says temporary deprecated aliases retain ci-fedora-autest, autest.sh, the old CMake options and targets. I checked each: option(ENABLE_AUTEST) and option(ENABLE_AUTEST_UDS) are replaced outright, the three gates now test ENABLE_URTEST only, and tests/CMakeLists.txt renames the autest, autest_no_install and autest-uds targets with no ALIAS or forwarding target. CMakePresets.json has only ci-fedora-urtest, and there is no tests/autest.sh. The only deprecation shims are AUTEST_SANDBOX, AUTEST_OPTIONS and PYTEST_OPTIONS, and those live inside if(ENABLE_URTEST), so they never fire for a caller passing the old option.

CMake treats an unconsumed -DENABLE_AUTEST=ON as an unused-variable notice, not an error, so an external pipeline configured that way configures successfully, silently skips add_subdirectory(tests), and produces no test target at all. A job using the old preset fails loudly instead, which is the better outcome. Either add real aliases or state plainly in the body that the cut-over is not backward compatible.

Framework items worth fixing while it is still a draft

  • tests/tools/uranium/runner.py:225 is_official_test_container() requires an exact ID == "fedora" and VERSION_ID == "44" match, and choose_docker_mode() defaults to Docker when that fails. When the CI image is bumped to Fedora 45 in some unrelated PR, urtest inside that container stops recognizing it, defaults to Docker mode, finds no docker client, and every shard dies. The safe default when already inside any container is to run directly.
  • tests/tools/uranium/replay.py:657-668 _check_metrics sleeps a fixed interval then reads each metric exactly once with no retry. _check_files in the same file already does this correctly with a 100ms deadline poll. 17 manifests use metric_checks, and sleep-then-assert-once under 8-way xdist is precisely the flake pattern this migration is meant to leave behind.
  • tests/tools/uranium/runtime.py:38 class RuntimeError(ValueError) shadows the builtin for the whole module, while process.py:29 defines ProcessError(RuntimeError) against the real builtin. Two unrelated hierarchies with the same spelling in one package.
  • tests/tools/uranium/replay.py:749 and :793 read_text() with no existence check, so a missing diags or gold file surfaces as a raw traceback into framework internals rather than the intended message. Every sibling path in the same class already guards with if path.exists().

One claim I checked and am withdrawing before anyone chases it: I initially thought ReplayItem.runtest hardcoding is_exclusive=False broke serial_tests.txt for replay manifests. On re-reading it is latent rather than live, so it is worth tidying but it is not causing anything today.

@bneradt
bneradt force-pushed the pytest-replay-tests branch from c654ac4 to c680be9 Compare August 18, 2026 22:20
@bneradt

bneradt commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review. I addressed the feedback and force-pushed the amended commit.

  • Removed both unrelated production changes from this PR. The max-stale percentage feature landed separately in Add percentage limit for stale cache age #13547. The converted certificate-update scenario is now a strict expected failure for the pre-existing TSSslClientCertUpdate defect, which can be fixed separately.
  • Updated the Jenkins, coverage, and regression scripts to invoke Uranium and use pytest's -k and -n options.
  • Kept this as an intentional clean cutover rather than an AuTest compatibility shim. Removed AuTest CMake variables now produce explicit migration errors, and I updated the PR description accordingly.
  • Changed automatic execution to avoid nested Docker in any detected container, while retaining the explicit Docker override flags.
  • Changed metric checks to poll until their deadline.
  • Added explicit assertions for missing actual, gold, and diagnostic files.
  • Renamed the framework's local RuntimeError to RuntimeConfigError.

I also normalized direct replay placement, fixed the stale documentation includes, and reran the relevant validation: the documentation build passes with warnings treated as errors, all 371 replay variants passed or reached expected capability skips, and the 51 framework unit tests pass.

@bneradt

bneradt commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci autest]

@bryancall

Copy link
Copy Markdown
Contributor

I benchmarked this migration on dedicated hardware rather than reasoning about it, because a harness swap of this size deserves numbers. Summary up front: Uranium is 7.4x faster at 32-way parallelism, loses no code coverage, uses less memory, and has fewer flaky tests. Details and methodology below, including the parts that do not favour the new harness.

Methodology

Two hosts, both 32 hardware threads, 30 GB RAM, Fedora, gcc 16.1.1, Proxy Verifier v3.1.3 on both sides (verified identical, checksum 342286244d...). Timing on one host, coverage on the other, and each host ran both harnesses so every comparison is within-host.

  • master at a2ea029215, this branch at 7fcbc9d69
  • Python pinned identically for every run, dependencies resolved from the checked-in tests/uv.lock
  • Timing used Release builds; coverage used separate gcov builds, since -O0 plus instrumentation distorts wall clock by about 1.5x
  • Coverage counters were reset before each run and only the integration suite was measured. Unit tests are identical on both sides and including them would dilute exactly the delta in question.

The proxy binary is the same on both sides. I checked this rather than assuming it, because the whole comparison depends on it. After normalizing embedded build paths, both binaries disassemble to 1,341,244 instructions and the instruction streams are identical once addresses are masked. The residual byte differences are relocation displacements from embedded path and timestamp strings of different lengths, spread across 1,265 unrelated symbols in single-byte runs. So every number below is harness overhead, not a proxy change.

Performance

Full suite, same host, same binary:

Workers AuTest Uranium Speedup
4 3230s 914s 3.5x
8 2254s 497s 4.5x
16 1749s 293s 6.0x
32 1591s, 1596s 215s, 215s, 202s 7.4x

The gap widens with worker count, which points at the mechanism:

AuTest Uranium
Total work 4873s of worker time 3899s of test time
Wall clock 1031s 215s
Effective parallelism 4.7x 18.1x

AuTest's worker durations at -j32 were min 113s, median 155s, max 889s. One worker set the wall clock while roughly 30 sat idle behind it.

The cause is that AuTest's load balancing never engages. autest-parallel.py has an LPT balancer that reads <sandbox>/test-timings.json, but that file is never written: the save at line 1135 is gated on tests_timed > 0 and the per-worker timing dictionaries come back empty. Every run logs Using round-robin partitioning verbatim, and I confirmed no timings file exists after seven runs. This is not a cold-start artifact, it is the steady state. Worth knowing regardless of this PR's outcome, since it means the current suite is leaving most of the machine idle.

Uranium's per-test distribution for reference: p50 1.13s, p95 9.17s, max 90.6s.

Code coverage

gcov plus gcovr 8.6, identical flags and exclusions on both sides, integration suite only:

AuTest Uranium Delta
Lines 51.0% (96,576 / 189,482) 51.1% (96,784 / 189,482) +208
Functions 60.7% (11,376 / 18,726) 60.8% (11,392 / 18,726) +16
Branches 25.6% (77,497 / 302,664) 25.6% (77,583 / 302,664) +86

No coverage is lost. Uranium is fractionally ahead on all three measures. This is the number that matters most, since a 7.4x speedup naturally raises the question of whether the suite is simply doing less. It is not. The denominators are identical on both sides, which independently corroborates the binary-equivalence check above.

Memory

Peak resident memory across the whole process tree:

Workers AuTest Uranium
4 3.78 GB 3.66 GB
8 5.48 GB 4.52 GB
16 7.47 GB 5.69 GB
32 11.0 to 12.26 GB 9.64 to 10.03 GB

Uranium uses less memory at every level, with the gap widening to about 31% at 16 workers. Neither harness came close to exhausting 30 GB.

Caveat worth stating: these are summed RSS across all processes, which double counts pages shared between the many concurrent Traffic Server instances, so treat them as upper bounds. The idle baseline was 0.97 GB, so roughly 92% of each figure is genuine workload. I am re-measuring with proportional set size to remove the double counting and will follow up if it changes the picture.

Flakiness

Seven AuTest runs and six Uranium runs, across all parallelism levels:

Harness Test Failed in Verdict
AuTest per_client_connection_max 7/7 deterministic
AuTest cripts 7/7 deterministic
AuTest h2_malformed_request_logging 2/7 flaky
AuTest session_id 1/7 flaky
Uranium test_all_bespoke_tests_are_available_to_pytest 6/6 deterministic
Uranium log_mstsms 2/6 flaky

Two observations that only a repeated run surfaces.

A flaky test was distorting the timing. AuTest at -j32 came in bimodal: 1031s, 1039s, then 1591s, 1596s. The fast runs are the ones where h2_malformed_request_logging failed; the slow ones are where it passed. Its success path costs roughly 550 seconds more than its failure path. A single measurement would have reported a figure that flattered AuTest by 35%.

AuTest does not run a deterministic set of tests. Executed totals across runs were 586, 586, 586, 586, 586, 583, 581. At -j8 three tests silently disappear and at -j4 five do, with no diagnostic. Uranium collected exactly 1207 items in all six runs with no drift. For a suite whose purpose is regression detection, that difference matters as much as the speed.

Test inventory

I mapped all 564 master *.test.py files against the branch. 388 matched by directory and stem; I resolved the remaining 176 individually by reading each successor rather than inferring from names.

Exactly one test has no successor: tests/gold_tests/cache/cache-write-lock-contention.test.py. Severity is low since it was already SkipUnless(RUN_CACHE_CONTENTION_TEST=1), so CI signal is unchanged, but the scenario is gone and the gate variable is now dead plumbing: tests/tools/uranium/runner.py still forwards RUN_CACHE_CONTENTION_TEST into the container and nothing reads it. Either restore the scenario or drop the plumbing.

Everything else is verified consolidation, and the counts hold up: the 18 tls_hooks files became a 17-entry parametrization plus one function, the 7 cont_schedule files became a 7-entry parametrization, 38 txn_box tests became 35 manifests with three merged pairs, and cache grew from 39 to 70. I also confirmed the master merge converted the two tests #13547 added after my baseline rather than dropping them.

Other findings

  • ci/coverage cannot collect coverage as written. It calls the build-tree ./urtest.sh -n "$NPROCS" without --no-run-in-docker. Since choose_docker_mode() returns not is_container(), on any non-container host that shells out to Docker and discards the gcov-instrumented build the script just made. I had to bypass this script to get the coverage numbers above.
  • ci/regression and ci/jenkins/bin/autest.sh no longer exercise the tree they build. Source-mode urtest.sh always runs its own cmake --preset urtest into build-urtest-container, so $DSTROOT and ${INSTALL} are ignored and the build above the test call is dead weight.
  • tests/uv.lock never reaches the build tree. tests/CMakeLists.txt copies only pyproject.toml, but runner.py runs uv --project <build>/tests, so the vetted lock is unused and every first run resolves fresh against PyPI. This bit me concretely: without an explicit pin, uv selected Python 3.12.12 on a host whose system interpreter is 3.14. Copying uv.lock alongside pyproject.toml is a one-line fix and makes runs reproducible.
  • test_all_bespoke_tests_are_available_to_pytest fails deterministically, in all six runs. A framework self-check reporting that the declared inventory does not match what pytest collects is worth resolving before this lands, since it is the test that would otherwise catch a conversion gap.
  • The documentation contradicts the code on Docker detection. uranium-tests.en.rst describes a two-condition rule (container and Fedora 44); choose_docker_mode() checks only is_container().
  • if(DEFINED ENABLE_AUTEST) fires even for -DENABLE_AUTEST=OFF, which will surprise anyone carrying that flag in a script. The companion guard for AUTEST_SANDBOX / AUTEST_OPTIONS / PYTEST_OPTIONS sits inside if(ENABLE_URTEST), so it misses the common case.
  • Replay manifests cannot be marked serial. _is_serial_test matches only .py paths and ReplayItem.runtest() always takes the shared lock, so a .test.yaml listed in serial_tests.txt would be silently ignored. Latent today since the file lists only .py entries, but it is a trap for whoever first needs an exclusive replay.
  • Sharding moved into the repository, which the PR body understates. SHARD and SHARDCNT appear nowhere on master; the 1of4 through 4of4 split is external Jenkins configuration. This PR implements sharding in-repo as a modulo stripe over sorted node IDs, so any existing per-shard intuition about which tests land where is void, and ci/jenkins/bin/autest.sh now passes no shard flags at all. Worth confirming the Jenkins job definitions move in lockstep.

Overall

The performance and determinism case is strong and I would not have predicted the margin. The two things I would want resolved before this leaves draft are the ci/coverage Docker bug, since it silently disables coverage collection, and the deterministic test_all_bespoke_tests_are_available_to_pytest failure. The single lost test and the uv.lock plumbing are small and easy.

Happy to share the raw logs, per-test timing data, or the gcovr HTML reports for either side.

@bneradt
bneradt marked this pull request as ready for review August 19, 2026 17:46
Copilot AI review requested due to automatic review settings August 19, 2026 17:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@bneradt
bneradt force-pushed the pytest-replay-tests branch from 7fcbc9d to f3d4785 Compare August 19, 2026 19:24
Copilot AI review requested due to automatic review settings August 19, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings August 19, 2026 20:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

bneradt added 3 commits October 20, 2026 15:42
New upstream connection-pool regressions would be undiscovered in their
AuTest form, and the converted retry test needs the upstream protection
against reusing an origin connection before its close is observed.

This patch registers the three pool cases as direct replay tests, with
opt-in origin shutdown before metric checks to preserve their lifecycle.
It carries the early-reset session-sharing policy into the pytest scenario.

Co-authored-by: GPT-6 Astra Medium
Test migrations can silently lose assertions or change process
lifetimes even when their replacements pass. Contributors need the
lessons from the Uranium migration available in the repository.

This patch adds a shared conversion skill covering test selection,
semantic parity, rebase audits, and focused verification.

Co-authored-by: GPT-6 Astra Medium
The new upstream rate-limit regression would not run as an AuTest
wrapper in the pytest suite.

This patch expresses the excluded and ordinary SNI requests as a
self-contained replay, preserving TLS admission checks and the
client-IP exclusion diagnostic.

Co-authored-by: GPT-6 Astra Medium
Copilot AI lite review requested due to automatic review settings October 20, 2026 20:44
@bneradt
bneradt force-pushed the pytest-replay-tests branch from 4d94215 to dc60550 Compare October 20, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bryancall bryancall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Request changes

I re-reviewed deb7f8e70..dc60550ea. git range-diff c8935543e..deb7f8e70 7f49e4c6b..dc60550ea pairs all 28 commits I last reviewed: 20 are identical, and 8 carry only rebase resolution (master's AuTest edits moved into their Uranium files). The response is five new commits, 116 files, +2,601/-5,020. The rebase onto current master is thorough and I checked it file by file. None of the five asks I left open on 10-06 moved, though: plugin.py, runtime.py, test_virtualhost_remap.py, config_reload_helpers.py and the slice assertion are byte-identical to deb7f8e70. I also found one PR-wide gap that I missed in earlier rounds.

Fixed: conflicts with master

GitHub now reports the branch mergeable, and its merge-base is 7f49e4c6b, the tip of master. git ls-tree -r HEAD tests/gold_tests is empty, and no *.test.py remains under tests/uranium_tests.

I checked all 179 entries in git diff --name-status c8935543e 7f49e4c6b -- tests/gold_tests (121 added, 58 modified) against their counterparts at dc60550ea. 170 carry master's change faithfully. That includes all 20 new AuTests I listed last time, the TLS resumption tests, the pool_lock backoff line (#13874) in the global and hybrid manifests only, and the 127.0.0.1 origins in all 14 cookie_remap tests (#13875). Of the other nine, one is an AuTest helper that needs no counterpart, and the rest are in the non-blocking sections below.

Still blocking: the virtualhost conversion lost its "refused reload fails" assertion

Unchanged since deb7f8e70. tests/uranium_tests/remap/test_virtualhost_remap.py:110-112 still runs the conflicting reload without -m, requires exit 0, and calls wait_for_status(ats, "vhost-conflict", "virtualhost", "fail"). That substring check passes whether or not the task failed, and my 10-06 mutation (ctx.fail changed to ctx.complete at src/proxy/VirtualHost.cc:545) left it green.

What would change my mind: assert the virtualhost task status from the JSON-RPC response, as test_config_reload_rpc.py does, or restore -m with expected_return_codes=(2,).

Still blocking: procedural tests no longer check diags.log for errors

This one predates this push, and I should have caught it earlier. AuTest's MakeATSProcess failed any test whose diags.log contained ERROR:, FATAL: or Unrecognized configuration value, unless the test set disable_log_checks (tests/gold_tests/autest-site/trafficserver.test.ext:253-258 on master). Uranium keeps that default only for replay manifests (tests/tools/uranium/replay.py:805-811). A procedural test's ATS.close() checks only FATAL: (tests/tools/uranium/services/ats.py:649), and nothing else in tests/tools/uranium looks for ERROR: or Unrecognized configuration value.

The result is that a misspelled record name, or an ERROR: the old test would have caught, now passes in every procedural test that does not scan diags itself. Of the 350 test_*.py files under tests/uranium_tests, 14 mention ERROR: at all. It also makes disable_log_checks= a silent no-op: h2/origin_test_helpers.py:30 documents it as "Replace default error checks", and 10 procedural files pass it to ats_factory.create, which drops it. The new conversion guide in .claude/skills/convert-autest-to-urtest/SKILL.md does not mention the difference, so future conversions will repeat it.

What would change my mind: ATS.close() applying the same three exclusions as replay.py unless disable_log_checks is set, plus a framework self-test where a procedural test with ERROR: in diags goes red. Expect some procedural tests to need disable_log_checks=True once the check is live. That is the point.

I found this by reading the source, not by running it.

Half done: ask 5, the dead parameter and the test that does not cover the shipped line

Unchanged. runtime.py is byte-identical to deb7f8e70, so item_sandbox still never reads replay_path, and reverting parent= in replay.py still leaves the self-tests green.

Half done: ask 6, the collision guard still crashes under -n

Unchanged. plugin.py:123-128 still raises UsageError from pytest_collection_modifyitems on every worker, which ends a -n 2 run in INTERNALERROR / assert not crashitem.

Half done: ask 8, ENOLCK and cross-file names

Unchanged. plugin.py:105 still catches only BlockingIOError, and runtime.py still drops the file path from the sandbox name.

Not addressed: ask 12, the slice alternation

Unchanged at test_slice_stale_generation.py:258-261. The alternation is still unbracketed.

Not addressed: five Copilot threads from 10-01

All five are still open, and each file is byte-identical to deb7f8e70: the ENABLE_AUTEST fatal guard against contrib/docker/ubuntu/resolute/Dockerfile, the dead rat-exclude.txt path, config-reload-ext.en.rst documenting Test.AddConfigReload(), TSHttpHookAdd.en.rst:148-149 naming test_hooks.test.py, and the jax_fingerprint README saying AuTests.

Non-blocking: remap_https lost its header checks and its chunked path

This dates from the original conversion. The AuTest checked curl's stderr against gold files on eight runs (remap_https.test.py:76-124 at c8935543e). tests/uranium_tests/remap/replay/remap_https.test.yaml:63-90 checks status codes only. #13763 then framed only the TLS origin, with the comment "the plaintext origin exercises ATS chunking". The manifest sends Content-Length: 0 from every origin, so the chunked response that remap-https-200.gold asserted is no longer exercised at all. Both copies of remap-https-200_2.gold are now referenced by nothing.

Non-blocking: changes in this push worth a second look

  • tls/test_tls_sni_groups.py:116-121,129-134. It now forces -tls1_2 and -tls1_3 on the client. The old curl check (SSL connection using TLSv1.2 / ...) proved the server enforced valid_tls_versions_in. With the client pinned, a broken version restriction passes.
  • tls/replay/dual_cert_default_ec_rsa.replay.yaml:24. The dest_ip: "" entry is now signed-san-ec.pem,signed-san.pem. Master has signed-san.pem,signed-san-ec.pem, which gave a mixed layout. If the reorder is intended, say so in the commit, because the mixed case is no longer tested.
  • pluginTest/slice/replay/slice_body_headers.test.yaml:68-70 adds Connection: close to the /dup_te request, which master's replay does not have. What did it fix? I want to be sure it is not hiding a Uranium-only problem.
  • tls/test_tls_resumption_scope.py:221-224,261-262 check only the traffic_ctl exit code, where the AuTests also required the sni.yaml and ssl_multicert.yaml reload tasks (expect_tasks). In the same file, the client-CA scope case now counts only ^200 bbb.example.com$ in squid.log, where the AuTest allowed no bbb.example.com line at all, so a non-200 entry for it now passes.
  • rate_limit_sni_exclude.test.yaml cannot tell an excluded SNI from a limited one on admission, since each SNI makes one connection under limit: 1. The "excluded via List=loopback" check carries it. An exclude for Limiter on limited.example.com is excluded would close that, and the gap came over from the AuTest.
  • tests/tools/uranium/tests/test_replay.py:29 parametrizes stop_after_client as False and True only, so the default with the key absent is never exercised. The replay.py:120-121 change itself is correct.
  • Orphans. timeout/slow_server_uds.yaml is referenced by nothing, so nothing selects the UDS replay that inactive_client_timeout.test.py used under CurlUsingUnixDomainSocket(). session_sharing/gold/200_two.gold and h2/gold/h2o-pool-reuse-metrics.gold are unreferenced too. Wire them up or delete them.

Not verified by execution

I did not build or run anything this round, since the asks above stand either way. Everything here comes from reading the source at dc60550ea and from my 10-06 runs on files that have not changed since.

@bryancall bryancall mentioned this pull request Oct 21, 2026
26 tasks

@bryancall bryancall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approve

Agreed: merge now, follow up in #13877

Approving so this lands before master drifts again. CI is green on dc60550ea, and the trafficserver-ci pipelines already switch to Uranium when tests/urtest.sh is present. I moved everything still open from my reviews into #13877. Please take the diags ERROR: check first: every procedural test written before it lands is one more to sort out once it does.

@bryancall
bryancall merged commit a19054e into apache:master Oct 21, 2026
14 checks passed
bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 22, 2026
The supported 10.2.x branch still relies on AuTest while master uses
pytest, making test maintenance and CI behavior diverge between releases.

This patch backports the Uranium framework and converted tests from
apache#13545, preserving the branch-specific coverage and configuration
formats. It includes the Bash 3 compatibility fix from apache#13884 and adapts
the build, documentation, and test helpers for the release branch.

The migration also includes the outbound connection-accounting fix
carried by apache#13545. Pending connections retain their tracker reservation
until the resulting session takes ownership, preserving per-origin
connection counts and limits when transactions share a connection attempt.
The converted connection-limit tests exercise this production behavior.

Co-authored-by: GPT-6 Astra Medium
bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 22, 2026
The supported 10.2.x branch still relies on AuTest while master uses
pytest, making test maintenance and CI behavior diverge between releases.

This patch backports the Uranium framework and converted tests from
apache#13545, preserving the branch-specific coverage and configuration
formats. It includes the Bash 3 compatibility fix from apache#13884 and adapts
the build, documentation, and test helpers for the release branch.

The migration also includes the outbound connection-accounting fix
carried by apache#13545. Pending connections retain their tracker reservation
until the resulting session takes ownership, preserving per-origin
connection counts and limits when transactions share a connection attempt.
The converted connection-limit tests exercise this production behavior.

Co-authored-by: GPT-6 Astra Medium
bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 25, 2026
The supported 10.2.x branch still relies on AuTest while master uses
pytest, making test maintenance and CI behavior diverge between releases.

This patch backports the Uranium framework and converted tests from
formats. It includes the Bash 3 compatibility fix from apache#13884 and adapts
the build, documentation, and test helpers for the release branch.

The migration also includes the outbound connection-accounting fix
carried by apache#13545. Pending connections retain their tracker reservation
until the resulting session takes ownership, preserving per-origin
connection counts and limits when transactions share a connection attempt.

Co-authored-by: GPT-6 Astra Medium
bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 26, 2026
The supported 10.2.x branch still relies on AuTest while master uses
pytest, making test maintenance and CI behavior diverge between releases.

This patch backports the Uranium framework and converted tests from
apache#13545, preserving branch-specific coverage and configuration formats.
It includes the Bash 3 compatibility fix from apache#13884 and adapts the
build, documentation, and test helpers for the release branch. Explicit
replay comparisons and native checks preserve the original assertions.

The migration also includes the outbound connection-accounting fix
carried by apache#13545. Pending connections retain their tracker reservation
until the resulting session takes ownership, preserving per-origin
connection counts and limits when transactions share a connection attempt.

HTTP/2 closes its network connection before session-close hooks run.
This patch preserves the peer, effective client, and local endpoints so
those hooks can still inspect valid addresses, including PROXY protocol
addresses. Regression checks exercise ordinary and PROXY HTTP/2 sessions.

Co-authored-by: GPT-6 Astra Medium
cmcfarlen pushed a commit that referenced this pull request Oct 28, 2026
* Backport Uranium tests to 10.2.x

The supported 10.2.x branch still relies on AuTest while master uses
pytest, making test maintenance and CI behavior diverge between releases.

This patch backports the Uranium framework and converted tests from
#13545, preserving branch-specific coverage and configuration formats.
It includes the Bash 3 compatibility fix from #13884 and adapts the
build, documentation, and test helpers for the release branch. Explicit
replay comparisons and native checks preserve the original assertions.

The migration also includes the outbound connection-accounting fix
carried by #13545. Pending connections retain their tracker reservation
until the resulting session takes ownership, preserving per-origin
connection counts and limits when transactions share a connection attempt.

HTTP/2 closes its network connection before session-close hooks run.
This patch preserves the peer, effective client, and local endpoints so
those hooks can still inspect valid addresses, including PROXY protocol
addresses. Regression checks exercise ordinary and PROXY HTTP/2 sessions.

Co-authored-by: GPT-6 Astra Medium

* Isolate nested Uranium test sandboxes

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

---------

Co-authored-by: bneradt <[email protected]>
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, Backported Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants