On Thu, Sep 26, 2024 at 12:18:52PM +0900, Yasuhito FUTATSUKI wrote: > On 2024/09/26 10:59, Yasuhito FUTATSUKI wrote: > > On 2024/09/26 7:43, Yasuhito FUTATSUKI wrote: > >> On 2024/09/26 6:43, Yasuhito FUTATSUKI wrote: > >>> However, if weakref for 'handler' object might still remain after > >>> the last strong reference is cleared, this test is incomplete and > >>> it should rewrite to a test based on sys.getrefcount(). > >> > >> Or ensure that weakref is cleared by gc. > > I'm sorry, it is not correct. With gc.collect(), even there exists > > circular references, objects are cleared if those aren't refered > > by others. > > > > So the patch below breaks the tests themselves. > > I rewrote those test by using sys.getrefcount() instead of weakref.ref() >
Thank you. There seems to be a local problem with my setup which caused this. After rebuilding everything the tests is passing again. And I have tested your patch. With your patch applied, the test is likewise passing for me. Perhaps the issue is a race condition? In any case, I will let you decide whether your prefer leaving the test as it is or whether your new patch improves the test and should be committted.