Skip to content

test_reading_output_allocates_nothing fails on Python 3.10: 73 objects allocated where the invariant says zero #62

Description

@bdbarnett

tests/test_component_foundation.py:375 asserts that reading a component's output allocates nothing. On Python 3.10 it allocates 73 objects; on 3.11, 3.12, 3.13, 3.14 and macOS it allocates zero.

FAIL: test_reading_output_allocates_nothing (test_component_foundation.TheLiveSurface)
  File ".../tests/test_component_foundation.py", line 375, in test_reading_output_allocates_nothing
    self.assertEqual(third - second, 0)
AssertionError: 73 != 0

Evidence: run 34304901624, job test (ubuntu-latest, 3.10)Ran 924 tests, FAILED (failures=1, skipped=2). The same run is green on 3.11/3.12/3.13/3.14 and macOS.

Why it matters more than a version quirk. This test guards the no-allocation-in-the-audio-path invariant that the whole component contract rests on, and the MCU targets are the ones that cannot afford allocation. Two readings, and they need separating before anything is changed:

  1. The 3.10 interpreter genuinely allocates where later ones do not (a CPython implementation difference the test is correctly detecting, and which says nothing about the library).
  2. The test's measurement is fragile — it is counting objects in a way that picks up interpreter bookkeeping rather than the component's own allocation.

If it is (2), the test has been passing on 3.11+ for a reason unrelated to the invariant, and the guard is weaker everywhere than it looks. That is the answer worth having, so do not fix this by skipping 3.10 or widening the bar until which of the two it is has been established.

Found while clearing the Lint failure on main. Tests has been red on main since the Phase 2 merge (2026-09-08); the other half of that red — rebuilt.known() failing on Windows — is fixed in 623c893. This one is unfixed and it is the only thing keeping main's Tests workflow red.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions