Showing content from http://mail.python.org/pipermail/python-dev/attachments/20130802/2242317a/attachment.html below:
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPhone</div><div><br>On 2 Aug 2013, at 14:51, Matt McClure <<a href="mailto:matthewlmcclure@gmail.com">matthewlmcclure@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div>It seems unittest.TestSuite holds references to unittest.TestCase instances after the test runs, until the test suite finishes. In a large suite, where the TestCase instances consume memory during execution, that can lead to exhausting all available memory and the OS killing the test process.</div></blockquote><div><br></div><div>Well individual tests not releasing resources could be seen as a bug in those tests.</div><div><br></div><div>That aside, there's an open bug for this with some discussion and a proposed fix:</div><div><br></div><div><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><a href="http://bugs.python.org/issue11798">http://bugs.python.org/issue11798</a></span></div><div><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><br></span></div><div><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; ">The agreed on approach just needs doing. </span></div><div><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><br></span></div><div><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; ">Michael</span></div><div><br></div><br><blockquote type="cite"><div><div>
<br></div><div>What do you think of a change like this?</div><div><br></div><div><div>$ hg diff</div><div>diff -r 3bd55ec317a7 Lib/unittest/suite.py</div><div>--- a/Lib/unittest/suite.py<span class="Apple-tab-span" style="white-space:pre"> </span>Thu Aug 01 23:57:21 2013 +0200</div>
<div>+++ b/Lib/unittest/suite.py<span class="Apple-tab-span" style="white-space:pre"> </span>Fri Aug 02 07:42:22 2013 -0400</div><div>@@ -90,7 +90,12 @@</div><div> if getattr(result, '_testRunEntered', False) is False:</div>
<div> result._testRunEntered = topLevel = True</div><div> </div><div>- for test in self:</div><div>+ while True:</div><div>+ try:</div><div>+ test = self._tests.pop(0)</div>
<div>+ except IndexError:</div><div>+ break</div><div>+</div><div> if result.shouldStop:</div><div> break</div><div> </div></div><div>See also the conversation on django-developers[1] that led me here.</div>
<div><br></div><div>[1]: <a href="https://groups.google.com/forum/#!topic/django-developers/XUMetDSGVT0">https://groups.google.com/forum/#!topic/django-developers/XUMetDSGVT0</a></div><div><div><br></div>-- <br>Matt McClure<br>
<a href="http://matthewlmcclure.com" target="_blank">http://matthewlmcclure.com</a><br><a href="http://www.mapmyfitness.com/profile/matthewlmcclure" target="_blank">http://www.mapmyfitness.com/profile/matthewlmcclure</a><br>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Python-Dev mailing list</span><br><span><a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a></span><br><span><a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a></span><br><span>Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk">http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk</a></span><br></div></blockquote></body></html>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4