Repository navigation
TestStructuredObjectRefcounting tests failing on Python 3.12b2 #23986
Copy link
Copy link
Closed
Description
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>]
Reactions are currently unavailable
Activity
rgommers commentedon Jun 19, 2023
I'm going to skip these for now in an attempt to get 3.12 wheels up
seberg commentedon Jun 19, 2023
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-leakswill still work, although I wouldn't be surprised if even that would just test no-ops)4294967295is the "immortal object" marker.TST: skip `TestStructuredObjectRefcounting` tests on py312
TST: skip refcount related tests on py312
TST: skip refcount related tests on py312
TST: skip refcount related tests on py312