Message314553
> Lib/test/support/__init__.py::threading_cleanup() complains about dangling threads even if the reference in question would be cleaned up by the garbage collector.
It's a deliberate choice. It helped me to find real bugs. For example, I found a very old reference cycle in socket.create_connection().
The error message ("dangling threads") doesn't help, but it means that "something is wrong" in your test.
Sadly, sometimes you have to explicitly do something like "self.thread = None" in your test.
I wrote an article to explain these things:
https://vstinner.github.io/contrib-cpython-2017q3-part2.html
Instead of calling support.gc_collect(), I suggest to write documentation, maybe as a comment in support.threading_cleanup()?, explaining the warning and how to fix it. Maybe with a link to this issue? :-) |
|
Date |
User |
Action |
Args |
2018-03-27 22:01:11 | vstinner | set | recipients:
+ vstinner, pitrou, christian.heimes, ezio.melotti, smurfix, njs |
2018-03-27 22:01:11 | vstinner | set | messageid: <1522188071.82.0.467229070634.issue32850@psf.upfronthosting.co.za> |
2018-03-27 22:01:11 | vstinner | link | issue32850 messages |
2018-03-27 22:01:11 | vstinner | create | |
|