/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Martin Pool
  • Date: 2006-05-08 04:39:50 UTC
  • mto: This revision was merged to the branch mainline in revision 1707.
  • Revision ID: mbp@sourcefrog.net-20060508043950-bb61b1e5ea33c349
Fix time-dependency in LockDir tests -- allow more margin for error in time to detect lock contention

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
            self.assertRaises(LockContention, lf2.wait_lock,
163
163
                              timeout=0.4, poll=0.1)
164
164
            after = time.time()
165
 
            self.assertTrue(after - before <= 1.0)
 
165
            # it should only take about 0.4 seconds, but we allow more time in
 
166
            # case the machine is heavily loaded
 
167
            self.assertTrue(after - before <= 8.0, 
 
168
                    "took %f seconds to detect lock contention" % (after - before))
166
169
        finally:
167
170
            lf1.unlock()
168
171