Author bkabrda
Recipients bkabrda
Date 2013-11-08.12:30:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When Python is compiled with COUNT_ALLOCS, some tests in test_gc and test_module fail. I'm attaching the patch that skips 3 of them and modifies assertions in one of them, so that the tests pass.

I'm however still unsure about one of the skipped tests, since I'm unsure whether I totally understand what's wrong there - test_gc_ordinary_module_at_shutdown.

My guess is that due to COUNT_ALLOCS causing immortal types, the "final_a" and "final_b" types don't get destroyed on line [1] as they do in builds without COUNT_ALLOCS. AFAICS they are only "un-immortalized" on this line and destroyed during the following loop [2]. The problem here is that the order of destroyed modules is not deterministic, so sometimes the builtins module gets destroyed before the "final_X" and there is no "print" function, which makes the __del__ functions from "final_X" fail. IMO the best thing to do is to just skip this test with COUNT_ALLOCS. But I may be wrong, I don't have a great insight into Python's GC and module unloading.

Date User Action Args
2013-11-08 12:30:13bkabrdasetrecipients: + bkabrda
2013-11-08 12:30:13bkabrdasetmessageid: <>
2013-11-08 12:30:13bkabrdalinkissue19527 messages
2013-11-08 12:30:13bkabrdacreate