~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Martin Pool
  • Date: 2006-02-21 22:33:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060221223325-0fbe4e9583b6d853
Breaking an already-released lock should just succeed

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        # now we should be able to take it
231
231
        lf2.attempt_lock()
232
232
        lf2.confirm()
 
233
 
 
234
    def test_44_break_already_released(self):
 
235
        """Lock break races with regular release"""
 
236
        t = self.get_transport()
 
237
        lf1 = LockDir(t, 'test_lock')
 
238
        lf1.attempt_lock()
 
239
        # someone else sees it's still locked
 
240
        lf2 = LockDir(t, 'test_lock')
 
241
        holder_info = lf2.peek()
 
242
        # in the interim the lock is released
 
243
        lf1.unlock()
 
244
        # break should succeed
 
245
        lf2.force_break()
 
246
        # now we should be able to take it
 
247
        lf2.attempt_lock()
 
248
        lf2.confirm()
 
249