Front-load the kit's subprocess test to dodge the macOS fork crash

test_kit_module_itself_never_imports_the_sdk shells out, and like every
subprocess-spawning test in this suite it crashes the interpreter with
SIGBUS on macOS/CPython 3.13 when it runs late enough that the process
holds many threads - the exact failure conftest already front-loads
test_datasette_package_never_imports_the_sdk for. Move it to the front
too, and note the hazard in assert_package_never_imports_sdk's docstring
since plugin suites will call it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012U7coQfVu8nK2R4q2mCULA
This commit is contained in:
Alex Garcia 2026-09-02 13:02:25 -07:00 • committed by GitHub
commit 33839b764a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 2 deletions

View file

@ -133,8 +133,16 @@ def test_linked_root_span_kwargs_with_no_current_span(otel_spans):
def test_kit_module_itself_never_imports_the_sdk():
# The kit imports the SDK lazily, so a plugin importing it at module
# level does not violate the api-only dependency rule.
"""
The kit imports the SDK lazily, so a plugin importing it at module
level does not violate the api-only dependency rule.
conftest.py's pytest_collection_modifyitems() moves this test to the
front of the run by name - if you rename it, rename it there too. Like
every subprocess-spawning test in this suite, running it late crashes
the interpreter on macOS/CPython 3.13 (SIGBUS in fork+exec once the
process holds enough threads) - see the comment there.
"""
assert_package_never_imports_sdk("datasette.telemetry_testing")