Repository navigation
Releases
Releases · alexchen-sys/ztest
ztest 0.6.0
Darwin platform support and a modular shim source layout, with the same
single-binary deployment and process-containment contract.
Added
- macOS
x86_64andarm64support throughsrc/pal/: kqueue-based
parent/supervisor death notification (NOTE_EXIT,NOTE_FORK,
NOTE_TRACK),LOCAL_PEERCRED/LOCAL_PEERPIDpeer identity,
libproc-backed child inspection,/dev/fddescriptor handling, and Darwin
ru_maxrssunit normalization. The existing process-group registry and
inactivity enforcement remain shared. See
ADR-004. - Thin Mach-O wheels for
macosx_10_13_x86_64andmacosx_11_0_arm64, plus the
existing two static-musl Linux wheels. Release assembly also produces a
universal2 tarball from both thin Darwin binaries. scripts/install.shsupport for Darwinarm64andx86_64, with
sha256sumor macOSshasum -a 256. SHA256SUMS verification is mandatory
for both online and offline installation; version and atomic-replacement
checks are unchanged.- Automatic best-effort import of the detected project package into the
zygote, disabled by--no-auto-preloadorZTEST_AUTO_PRELOAD=0. - The shim is split into numbered source sections under
src/shim/modules/
and deterministically bundled byscripts/bundle_shim.py;build.zig
enforces bundle freshness. The separately importable, stdlib-only project
detector is embedded and extracted beside the shim. - Mach-O and FAT-aware release validation: thin wheel payloads require the
advertised cputype, universal2 requires exactly onex86_64and onearm64
slice, and the sterility gate scans both slices for build-host paths.
Changed
- Configuration-size failures distinguish a single oversized value from the
aggregate serialized configuration limit (ConfigTooLarge) instead of
collapsing both into one diagnostic. - Release CI builds and gates four target artifacts, runs behavioral tests on
native Darwin runners, and checks Darwin ad-hoc signatures and system-only
dynamic linkage with Apple tools.
ztest v0.5.1
Distribution, reporting, and parity release. No change to the supervisor or the
worker model: the containment, scheduling and timeout behaviour benchmarked in
BENCHMARKS.md is unchanged.
Added
- Static
muslrelease binaries forx86_64andaarch64(builtReleaseSafe,
stripped, no build-host paths instrings), published to GitHub Releases and mirrored into
PyPI wheels under theztest-runnerdistribution name, sopip install ztest-runneranduvx --from ztest-runner ztestboth work without a
toolchain. scripts/install.sh: one-line installer that picks the matching release
binary, verifies its checksum, and installs into${ZTEST_INSTALL_DIR:-$HOME/.local/bin}.
The install is fail-closed: it refuses a directory or a non-ztest file on the
target path (--forceoverrides the latter), verifies the staged binary
reports the requested version before replacing anything, and after the atomic
rename checks that the file is executable and still reports it.- Test timeouts now raise a public
TestTimeoutError(no leading underscore) and
are reported as an ordinary failure with the test's node id and timeout value,
instead of a private class name leaking into user-visible output. === short test summary info ===at the end of a human-mode run, listing the
node ids of failures the worker reports asTEST_FAIL: failed, errored,
teardown-failed and collection-error tests, plus in-worker timeouts (which
raise the publicTestTimeoutErrorinside the test body). A timeout enforced
by the supervisor, which kills the worker, is not a per-test frame — it is
reported on its ownCRASHEDline for the file and does not appear in this
block. The block keeps at most 256 entries; when more fail, it ends with
... N more failed-test reports not shown(a record count — uniqueness past
the ring would need unbounded storage, so the line does not pretend to know
it), and a node id too long for its slot is cut at a UTF-8 boundary with a
…marker instead of disappearing.- Unknown command-line arguments are named in the diagnostic
(ztest: unrecognized argument '--foo') instead of a generic usage message. - Structural assertion diff for
assert a == b: adifflibunified diff over
the pretty-printed lines of sequences, sets and multi-line strings, and a
per-key delta for dictionaries (~ key: left -> right, plus
(only in left)/(only in right)entries). Both are capped at 80 lines
with an explicit truncation marker. The operator is echoed as(op: …)only
when it is not==;==keeps the two-value form without that suffix.
Changed
- Tracebacks drop internal runner frames (
unittest/case.py,result.py,
suite.py, the shim's own runner) so the reported stack starts in user code.
For a plain test function that is the same first frame pytest prints; for a
unittest.TestCaseit is a deliberate divergence — stock pytest ends its
--tboutput inunittest/case.py. The--llmlocfield is cleaned the
same way and therefore also points at user code. ztest --llmfailure records carry the same cleaned traceback and the public
timeout error type; the summary record is unchanged.
Fixed
- Four of the six Bench-100 divergences are closed with receipts:
execnet,
astroid,platformdirsandfreezegunreach FULL-PARITY under
--engine=pytest(2.93×, 3.00×, 2.07× and 1.15× faster than serial pytest).
The fifth,poetry-core, is the target of anaddoptsfix: the bridge now
keeps the-m/-k/-x/--maxfailfilters parsed out ofaddopts
when it retries with-o addopts=, so its 9 integration tests stay
deselected. Receipt-backed parity of the 96 suites with a green baseline rises
from 90/96 (93.8 %) to 94/96 (97.9 %); thepoetry-corerow puts the
number at an expected 95/96 (99.0 %) and is treated as measured only once
the release job confirms that row inBENCHMARKS.md.num2wordsremains a
documented behavioural difference (file-isolated workers versus a global
decimalmutation). - PyPI wheels are architecture-verified:
scripts/build_wheels.pyreads the
payload's ELF header (EI_CLASS,EI_DATA,e_machine) before packaging and
again inverify_wheel, so anx86_64binary can no longer ship under
aarch64tags. The architecture-blinddist/ztestfallback is gone; only
arch-bound tarballs andztest-<arch>files are accepted.Requires-Python
is now>=3.11, matching the documented runtime requirement. benchmarks/bench100_harness.py: measured runs were quantized to 50 ms.
CPython implementsPopen.wait(timeout=…)as anos.waitpid(WNOHANG)poll
loop with a backoff capped at 50 ms, so every run was rounded up to the next
tick (a 0.121 s run was recorded as 0.164 s) and ztest looked 25–35 % slower
than its ownduration_ms. The harness now reaps with a blockingwaitpidin
the reaping thread and enforces the run cap with a separate watchdog that kills
the process group at the deadline — overshoot is ~1 ms at 120 ms — and records
wall time to four decimals.benchmarks/bench100_harness.py:SAMPLE_INTERVAL(0.05 s) is now the single
PSS sampling cadence documented inBENCHMARKS.md— the sampler thread used to
hard-code0.05and never read the constant — and--helpprints usage
instead of raising on a missing--job.- Release CI builds the published musl binaries with
-Doptimize=ReleaseSafe,
the configurationREADME.mdargues for andBENCHMARKS.mdmeasured, and
gates their sterility withscripts/check_sterility.py: an occurrence-level
scan that rejects build-host paths (/home/…,/mnt/…,/opt/…,
.zig-cache,ztest-work,hunt-data) while allowing the runtime
/tmp/ztest_*templates and the production ignore-list literalzig-cache.
The previous line-oriented regex failed CI on those legal literals and would
have hidden a leak that shared onestringsline with them.install.shis
copied intodist/, so the documented
releases/latest/download/install.shURL is a real release asset.
Documentation
BENCHMARKS.mdrebuilt as v2.0: a containment and runaway section (hung C
extension,setsidorphans, OOM ceiling,--llmoutput volume), a four-arm
xdist memory matrix, the--engine=pytestparity table, sub-second wall times
at their real 0.01 s resolution, an Amdahl explanation for single-file suites,
and the fake211.67׆speedup on the crashedexecnetnative run replaced
with an honest dash.README.md: install-first layout (PyPI,uvx,install.sh, releases) and
three positioning sections — agent JSONL, ADR-004 containment, xdist
replacement.