On 6/10/2004, at 4:06 AM, Tim Peters wrote:
[Michael Dunstan]
I'm seeing test failures in transience when running the tests for Zope-2_7-branch (python 2.3.3) with garbage collection threshold0 set to 1. <snip> Whenever I see a test module import fauxtime, I run screaming in terror. This seems to be like running the multiprocess ZEO tests (from which I run screaming daily <wink>): "depending on" a gazillion timing accidents you can't control, sometimes they just fail.
I ran the tests above in a loop a few hundred times on my box just now, with no failures, Python 2.3.4 and command line:
test.py -vvLd -g1 --dir lib/python/Products/Transience/tests . testPathological
There's a big difference between my runs and yours, though: running the two tests took about 4.6 seconds on your box, but takes about 1.8 seconds on mine. Now, for example, if I add
oldtime.sleep(3) # approximately 4.6 - 1.8, on the high side
right before
map(self.t.__delitem__, r)
in testPathologicalRightBranching, then testPathologicalRightBranching fails every time in a way similar to your reported failure -- and even without -g1 on the command line.
If I change the sleep to 1.5, then (with -g1 again) sometimes it passes, sometimes not, depending on how busy the box is doing other stuff at the same time.
So that's A Problem. Any test that adds a bunch of stuff to a TransientObjectContainer and expects to *find* it all there later is implicitly assuming that the test runs fast enough so that containees don't vanish before their containedness is checked. I suspect you're seeing problems with -g1 here just because -g1 grossly slows the tests.
Doh! For some reason I had written that explanation off before posting. The pattern of missing keys did not seem consistent enough at the time. But, as you say, as soon as I comment out the use of faxtime and run those same two tests they both pass just fine. thanks michael