test: add some assert in the bookrace extension stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 19 Jun 2019 17:26:16 +0200
branchstable
changeset 42180 c4d1807b165f
parent 42179 febf5c8215c1
child 42181 95c2f951e502
test: add some assert in the bookrace extension This cannot hurt to have a bit more security in the test extension.
tests/test-bookmarks-corner-case.t
--- 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)