Skip to content

TestStructuredObjectRefcounting tests failing on Python 3.12b2 #23986

Closed

Description

@rgommers

Example failure:

           # Test item getting:
          part = arr[index]
          after_val0 = sys.getrefcount(val0)
  >       assert after_val0 - before_val0 == count * items_changed
  E       assert (4294967295 - 4294967295) == (6 * 2)
  
  after_val0 = 4294967295
  arr        = array([(-4, [[-4, -4, -4], [-4, -4, -4]]),
         (-4, [[-4, -4, -4], [-4, -4, -4]]),
         (-4, [[-4, -4, -4], [-4, -4, -4]])],
        dtype=[('a', '<i4'), ('b', 'O', (2, 3))])
  before_val0 = 4294967295
  before_val1 = 4294967295
  count      = 6
  dt         = dtype([('a', '<i4'), ('b', 'O', (2, 3))])
  index      = [True, False, True]
  items_changed = 2
  part       = array([(-4, [[-4, -4, -4], [-4, -4, -4]]),
         (-4, [[-4, -4, -4], [-4, -4, -4]])],
        dtype=[('a', '<i4'), ('b', 'O', (2, 3))])
  pat        = (0, [[<object object at 0x7fdf636fdd90>, <object object at 0x7fdf636fdd90>, <object object at 0x7fdf636fdd90>], [<object object at 0x7fdf636fdd90>, <object object at 0x7fdf636fdd90>, <object object at 0x7fdf636fdd90>]])
  self       = <numpy.core.tests.test_dtype.TestStructuredObjectRefcounting object at 0x7fdf55a9be60>
  shape      = (3,)
  singleton  = <object object at 0x7fdf636fdd90>
  val0       = -4
  val1       = -5
  
  ../venv/lib/python3.12/site-packages/numpy/core/tests/test_dtype.py:831: AssertionError

Full list of failures:

FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[ones-1-<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[ones-1-<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[ones-1-<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[ones-1-<structured subarray 2>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[zeros-0-<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[zeros-0-<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[zeros-0-<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_create_delete[zeros-0-<structured subarray 2>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_item_setting[<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_item_setting[<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_item_setting[<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_item_setting[<structured subarray 2>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape0-index0-2-<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape0-index0-2-<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape0-index0-2-<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape0-index0-2-<structured subarray 2>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape1-index1-4-<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape1-index1-4-<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape1-index1-4-<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape1-index1-4-<structured subarray 2>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape2-index2-2-<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape2-index2-2-<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape2-index2-2-<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape2-index2-2-<structured subarray 2>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape3-index3-2-<subarray>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape3-index3-2-<subarray in field>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape3-index3-2-<structured subarray 1>]
  FAILED core/tests/test_dtype.py::TestStructuredObjectRefcounting::test_structured_object_indexing[shape3-index3-2-<structured subarray 2>]

Activity

  1. rgommers commented on Jun 19, 2023

    @rgommers
    MemberAuthor

    I'm going to skip these for now in an attempt to get 3.12 wheels up

  2. seberg commented on Jun 19, 2023

    @seberg
    Member

    Skip it for good, Python 3.12 has immortal refcounts, I am not even sure its possible to test the refcounting for ones and zeros explicitly anymore. (I suppose pytest-leaks will still work, although I wouldn't be surprised if even that would just test no-ops)

    4294967295 is the "immortal object" marker.

  3. added 3 commits that reference this issue on Jun 19, 2023
    5ac6b32
    b799a60
    b0872b8
  4. added a commit that references this issue on Jun 30, 2023
    125f1dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions