Skip to content

fix two tests that have failed CI on every run since 2026-08-19 - #267

Merged
devdanzin merged 1 commit into
mainfrom
fix-ci-red-on-main
Sep 2, 2026
Merged

fix two tests that have failed CI on every run since 2026-08-19#267
devdanzin merged 1 commit into
mainfrom
fix-ci-red-on-main

Conversation

@devdanzin

Copy link
Copy Markdown
Owner

CI has been red on main for five consecutive merges — #261, #262, #263, #264, #265 (and
#266, which I merged on top of it). Neither failure is caused by any of those PRs. Both
are tests asserting a property of the interpreter build rather than of fusil, so both pass
on the local interpreters and fail on the python.org builds setup-python installs.

A permanently red CI catches nothing, which is exactly how a real regression gets in.

1. test_builtins_still_discoverable_under_only_c

AssertionError: 'math' not found in {'_tokenize', '_ast', 'sys', 'pwd', ...}

Whether math is compiled in or is a shared extension is a build choice. It is a builtin on
both interpreters here and an extension on CI, so the test was naming a module CI does not
have.

The invariant it actually guards — a builtin has no filename, so routing the seed through the
file-based --only-c check must not drop it — is now asserted over
sys.builtin_module_names, whatever this interpreter happens to contain.

2. test_tricky_objects_runs_without_types_CapsuleType

AssertionError: True is not false     # assertFalse(hasattr(shim, "CapsuleType"))

The test builds a shim types module holding every attribute except CapsuleType, to prove
the generated prelude survives a target that lacks it (PyPy 3.11, CPython < 3.13). It copied
__getattr__ along with everything else — and CPython 3.13 defines CapsuleType lazily
through a module-level __getattr__ (PEP 562)
, so the copy resolved the attribute straight
back to the real module and the shim stopped shimming.

3.14 defines it eagerly via _types, which is why this passed locally and failed only on the
3.13 job. Skipping __getattr__ fixes it.

No 3.13 is installed here, so I verified the mechanism against a simulated 3.13-style lazy
types rather than claiming a test run I did not do:

under a 3.13-style lazy types, shim hasattr CapsuleType: False

Scope

Tests only — no change to fusil. 1281 tests OK locally, ruff check and
ruff format --check both clean.

CI has been red on main for five consecutive merges (#261 through #266). Both
failures are tests asserting a property of the INTERPRETER BUILD rather than of
fusil, so both pass on the local interpreters and fail on the python.org builds
setup-python installs. A permanently red CI catches nothing, which is exactly how
a real regression gets in.

test_builtins_still_discoverable_under_only_c asserted `math` is discovered under
--only-c. Whether math is a builtin or a shared extension is a build choice: it is
compiled in on both local interpreters and is an extension on CI, so the test was
naming a module CI does not have. The invariant it actually guards -- a builtin has
no filename, so the file-based only-c check must not drop it -- is now asserted over
sys.builtin_module_names, whatever this interpreter happens to contain.

test_tricky_objects_runs_without_types_CapsuleType builds a shim `types` module with
every attribute except CapsuleType, to prove the prelude survives a target that
lacks it. It copied `__getattr__` along with everything else -- and CPython 3.13
defines CapsuleType LAZILY through a module-level __getattr__ (PEP 562), so the copy
resolved the attribute straight back to the real module and the shim stopped
shimming. 3.14 defines it eagerly via _types, which is why it passed here and failed
only on CI's 3.13 job. Skipping __getattr__ fixes it; verified against a
simulated 3.13-style lazy `types`, since no 3.13 is installed locally.

Neither fix touches fusil itself.
@devdanzin
devdanzin merged commit 1f02704 into main Sep 2, 2026
2 checks passed
@devdanzin
devdanzin deleted the fix-ci-red-on-main branch September 2, 2026 18:06
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.

1 participant