Another timing dependent test
John Arbash Meinel
john at arbash-meinel.com
Fri Apr 13 21:42:26 BST 2007
I'm trying to ferret out some of the random-failures for PQM tests. Most
of them are because of dependency on time.time() in one way or another.
I sent in a patch for 2 of them earlier. But I have another one I'm not
sure what to do with:
class SFTPLatencyKnob(TestCaseWithSFTPServer):
"""Test that the testing SFTPServer's latency knob works."""
...
def test_default(self):
# This test is potentially brittle: under extremely high machine
load
# it could fail, but that is quite unlikely
I found it... interesting that the test itself understood it could fail
but was "quite unlikely".
And I'll admit, if get_transport() takes 0.5s on PQM to run, that is an
unusual circumstance. However, the PQM is more loaded now that LP and
Bazaar tests can be run at the same time. (This actually was failed in
one of my merge requests)
I would like to fix it, but the best refactoring I can come up with is
whether 'time.sleep()' is being called. (By monkey patching time.sleep()).
I know this really wants to test that the latency knob is making things
slower, and it doesn't make much sense to test that it is slow with the
knob turned up without testing that it isn't slow without the knob.
Thoughts?
John
=:->
More information about the bazaar
mailing list