[merge] change tests to use reduceLockdirTimeout rather than reimplementing it
mbp at canonical.com
Mon Mar 17 23:46:41 GMT 2008
On 17/03/2008, Martin Pool <mbp at canonical.com> wrote:
> jml and I are working on <https://launchpad.net/bugs/172392>, and
> noticed that some tests hardcode something close to what
> reduceLockdirTimeout does, even though it's always set up by the
> TestCaseWithMemoryTransport base class.
> This actually gives it a 0 second timeout rather than 1 but I think
> this is equivalent - it still tries the lock once.
Thanks for the reviews.
Although cleaning up the code is nice, I think what it now
consistently does is not quite right. The thing is that tests now
cannot distinguish "lock immediately indicated contention" from "lock
would hang until it timed out". We might want to assert that one or
the other happens.
So maybe we should add a distinct "timed out waiting for lock", and
allow that to be raised even if we only waited 0 seconds.
More information about the bazaar