Skip to content

Make the observability test suite portable (macOS, Python 3.13+) - #1002

Merged
chrisgleissner merged 3 commits into
GideonZ:masterfrom
JC-000:fix/observability-portability
Oct 16, 2026
Merged

chrisgleissner merged 3 commits into
GideonZ:masterfrom
JC-000:fix/observability-portability

Conversation

@JC-000

@JC-000 JC-000 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #1001. A targeted fix for the observability failures discussed on #996. All changes are under tests/lib/observability, and the expected document is unchanged.

  • The golden canonicalizer matches the fixture temp directory wherever tempfile puts it (/var/folders/.../T/ on macOS, any TMPDIR without whitespace), not only under /tmp/.
  • The scripted suites run with PYTHONNODEBUGRANGES=1. Python 3.11+ then print one source line per frame and no ~^ marker lines, as 3.10 does, so the existing caret rule stays as it is.
  • When the golden document differs, the failure message now includes the changed lines (up to 12), not only the header and context.
  • Case [110] skips with a reason when 127.0.0.2 cannot be bound (EADDRNOTAVAIL, macOS without a loopback alias). Any other OSError still fails. On Linux this case behaves as before.

Tested with python -I tests/lib/observability_test.py:

Environment master this branch
macOS, Python 3.13 [158] fails 180 cases pass
python:3.13 container (Linux) [158] fails pass
python:3.14 container (Linux) [158] fails pass
python:3.10 container pass pass
ubuntu:24.04 container, Python 3.12.3 (Kubuntu 24.04 userland) pass pass
  • In the ubuntu:24.04 container, with tests/requirements.txt installed in a venv, all 17 device-free suites give the same results on master (7d96844) and on this branch.
  • Two of those fail the same way on both: web-theme/web-index (no browser in the container), and registry (see below).
  • The [110] skip was checked by forcing an unaliased source address, because the test Mac already had the alias.
  • A review session constructed four changes to the expected document that master catches; the branch catches all four as well.

Not in this PR: on current master, registry_test fails because tests/e2e/io/iec/directory_rename_test.py (#1000) is not registered in run-tests SUITES.

Written with Claude Opus 5.5 in Claude Code and reviewed by a second Opus session.

🤖 Generated with Claude Code

JC-000 and others added 3 commits October 16, 2026 11:36
…on version

The canonicalizer matched only a literal /tmp/e2e-observability-fixture-
path, so macOS (/var/folders/.../T/) kept the temp dir in the document. And
Python 3.11+ print a ~~~^^^ marker line under a traceback frame while 3.13
prints every line of a multi-line statement, so the report differed from the
checked-in one. Match the fixture directory wherever tempfile put it, and
run the scripted suites with PYTHONNODEBUGRANGES=1 so tracebacks read as
they do on 3.10.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The failure detail was the first six lines of the diff, which are the
header and context, so a log never said what changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Linux answers for all of 127/8; macOS has only 127.0.0.1 on lo0 unless an
alias was added, and the case errored with Errno 49 instead. Any other
OSError still fails the case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chrisgleissner

Copy link
Copy Markdown
Collaborator

Thanks a lot @JC-000 for helping to improve our test infrastructure - much appreciated!

@chrisgleissner

Copy link
Copy Markdown
Collaborator

Checked on Linux, Python 3.12.3. The change is limited to tests/lib/observability, so no device E2E suite is affected.

  • python -I tests/lib/observability_test.py: 180 cases, 2 skipped, OK.
  • lint_test, runner_policy_test and stale_gates_test: OK.
  • Read the diff: the temp-directory regex, PYTHONNODEBUGRANGES, the larger failure message and the EADDRNOTAVAIL-only skip for 127.0.0.2 are all narrow and keep Linux behaviour unchanged.

Merging.

@chrisgleissner
chrisgleissner merged commit ee83dd4 into GideonZ:master Oct 16, 2026
1 check passed
@JC-000
JC-000 deleted the fix/observability-portability branch October 16, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Observability test suite fails on Python 3.13+ and on macOS

2 participants