changeset 42508:c4d1807b165f stable

test: add some assert in the bookrace extension This cannot hurt to have a bit more security in the test extension.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 19 Jun 2019 17:26:16 +0200
parents febf5c8215c1
children 95c2f951e502
files tests/test-bookmarks-corner-case.t
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-bookmarks-corner-case.t	Wed Jun 19 05:46:07 2019 +0200
+++ b/tests/test-bookmarks-corner-case.t	Wed Jun 19 17:26:16 2019 +0200
@@ -121,8 +121,10 @@
   > import atexit
   > from mercurial import error, extensions, bookmarks
   > 
-  > def wait():
+  > def wait(repo):
   >     if not os.path.exists('push-A-started'):
+  >         assert repo._currentlock(repo._lockref) is None
+  >         assert repo._currentlock(repo._wlockref) is None
   >         print('setting raced push up')
   >         with open('push-A-started', 'w'):
   >             pass
@@ -134,7 +136,7 @@
   >         time.sleep(0.1)
   > 
   > def wrapinit(orig, self, repo):
-  >     wait()
+  >     wait(repo)
   >     return orig(self, repo)
   > def uisetup(ui):
   >     extensions.wrapfunction(bookmarks.bmstore, '__init__', wrapinit)