##// END OF EJS Templates
test: factor out the "wait" logic in bookrace...
marmoute -
r42707:febf5c82 stable
parent child Browse files
Show More
@@ -120,7 +120,8 b' We build a server side extension for thi'
120 > import time
120 > import time
121 > import atexit
121 > import atexit
122 > from mercurial import error, extensions, bookmarks
122 > from mercurial import error, extensions, bookmarks
123 > def wrapinit(orig, self, repo):
123 >
124 > def wait():
124 > if not os.path.exists('push-A-started'):
125 > if not os.path.exists('push-A-started'):
125 > print('setting raced push up')
126 > print('setting raced push up')
126 > with open('push-A-started', 'w'):
127 > with open('push-A-started', 'w'):
@@ -131,6 +132,9 b' We build a server side extension for thi'
131 > if clock <= 0:
132 > if clock <= 0:
132 > raise error.Abort("race scenario timed out")
133 > raise error.Abort("race scenario timed out")
133 > time.sleep(0.1)
134 > time.sleep(0.1)
135 >
136 > def wrapinit(orig, self, repo):
137 > wait()
134 > return orig(self, repo)
138 > return orig(self, repo)
135 > def uisetup(ui):
139 > def uisetup(ui):
136 > extensions.wrapfunction(bookmarks.bmstore, '__init__', wrapinit)
140 > extensions.wrapfunction(bookmarks.bmstore, '__init__', wrapinit)
General Comments 0
You need to be logged in to leave comments. Login now