comparison mercurial/localrepo.py @ 51448:9da3fcc5f70f stable

test-lock: use synchronisation file instead of sleep This will prevent the test to be flaky on load.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 11 Mar 2024 16:05:28 +0100
parents 04111ef08fb0
children fcc149f3fdcb 0239ebdd0740
comparison
equal deleted inserted replaced
51447:5633de951d34 51448:9da3fcc5f70f
3070 if wait: 3070 if wait:
3071 timeout = self.ui.configint(b"ui", b"timeout") 3071 timeout = self.ui.configint(b"ui", b"timeout")
3072 warntimeout = self.ui.configint(b"ui", b"timeout.warn") 3072 warntimeout = self.ui.configint(b"ui", b"timeout.warn")
3073 # internal config: ui.signal-safe-lock 3073 # internal config: ui.signal-safe-lock
3074 signalsafe = self.ui.configbool(b'ui', b'signal-safe-lock') 3074 signalsafe = self.ui.configbool(b'ui', b'signal-safe-lock')
3075 sync_file = self.ui.config(b'devel', b'lock-wait-sync-file')
3076 if not sync_file:
3077 sync_file = None
3075 3078
3076 l = lockmod.trylock( 3079 l = lockmod.trylock(
3077 self.ui, 3080 self.ui,
3078 vfs, 3081 vfs,
3079 lockname, 3082 lockname,
3081 warntimeout, 3084 warntimeout,
3082 releasefn=releasefn, 3085 releasefn=releasefn,
3083 acquirefn=acquirefn, 3086 acquirefn=acquirefn,
3084 desc=desc, 3087 desc=desc,
3085 signalsafe=signalsafe, 3088 signalsafe=signalsafe,
3089 devel_wait_sync_file=sync_file,
3086 ) 3090 )
3087 return l 3091 return l
3088 3092
3089 def _afterlock(self, callback): 3093 def _afterlock(self, callback):
3090 """add a callback to be run when the repository is fully unlocked 3094 """add a callback to be run when the repository is fully unlocked