Skip to content

BUG: failing test_hierharchy_arraylist with jdk>=21 #736

Open
@h-vetinari

Description

When building pyjnius 1.6.1 against newer openjdk (21, 22) in conda-forge, things compile and run fine, with the exception of one test failure:

=================================== FAILURES ===================================
____________________ ReflectTest.test_hierharchy_arraylist _____________________

self = <test_reflect.ReflectTest testMethod=test_hierharchy_arraylist>

    def test_hierharchy_arraylist(self):
        d = identify_hierarchy_dict(find_javaclass("java.util.ArrayList"), 0, True)
        self.assertContains(d, "java.util.ArrayList")# concrete
        self.assertContains(d, "java.util.AbstractCollection")# superclass
        self.assertContains(d, "java.util.Collection")# interface
        self.assertContains(d, "java.lang.Iterable")# interface
        self.assertContains(d, "java.lang.Object")# root
        maxLevel = max(d.values())
>       self.assertEqual(d["java.lang.Object"], maxLevel)
E       AssertionError: 3 != 4

tests/test_reflect.py:38: AssertionError
=========================== short test summary info ============================
FAILED tests/test_reflect.py::ReflectTest::test_hierharchy_arraylist - AssertionError: 3 != 4
======================== 1 failed, 164 passed in 0.94s =========================

It seems all the expected hierarchy levels are still there, but either the hierarchy itself changed for real (meaning the test expectation is wrong), or the calculation in identify_hierarchy_dict needs to fix something to take into account the new reality.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions