Patchwork [4,of,7,STABLE] test: add some assert in the bookrace extension

login
register
mail settings
Submitter Pierre-Yves David
Date June 21, 2019, 2:04 a.m.
Message ID <26ed41f211a818da9df2.1561082651@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/40639/
State Accepted
Headers show

Comments

Pierre-Yves David - June 21, 2019, 2:04 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1560957976 -7200
#      Wed Jun 19 17:26:16 2019 +0200
# Branch stable
# Node ID 26ed41f211a818da9df24922089054c57e60a7cf
# Parent  62616ebca61fba1039e50832078c24d13918e545
# EXP-Topic book-del-stable
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 26ed41f211a8
test: add some assert in the bookrace extension

This cannot hurt to have a bit more security in the test extension.

Patch

diff --git a/tests/test-bookmarks-corner-case.t b/tests/test-bookmarks-corner-case.t
--- a/tests/test-bookmarks-corner-case.t
+++ b/tests/test-bookmarks-corner-case.t
@@ -121,8 +121,10 @@  We build a server side extension for thi
   > 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 @@  We build a server side extension for thi
   >         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)