Message 64612 - Python tracker
I think I've confirmed your diagnosis. If I add a _sleep(.01) to Thread.__bootstrap_inner() just after the call to self.__stop(), the test fails reliably. Very good catch! Given that, I think just adding a short sleep to the test before counting references will fix it nearly every time, but I'd like to kill the race dead if we can.