comparison tests/testlib/ext-stream-clone-steps.py @ 46986:faa43f09ad98

streamclone: remove sleep based "synchronisation" in tests Sleep based test synchronisation does not work. Variation in machine performance and load can make the two process miss their windows. Instead we migrate to explicit signaling through the file system as other tests file are using. Differential Revision: https://phab.mercurial-scm.org/D10478
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Apr 2021 19:12:28 +0200
parents
children 6000f5b25c9b
comparison
equal deleted inserted replaced
46985:52cee44aa1a0 46986:faa43f09ad98
1 from __future__ import absolute_import
2
3 from mercurial import (
4 encoding,
5 extensions,
6 streamclone,
7 testing,
8 )
9
10
11 WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1']
12 WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2']
13
14
15 def _test_sync_point_walk_1(orig, repo):
16 testing.write_file(WALKED_FILE_1)
17
18
19 def _test_sync_point_walk_2(orig, repo):
20 assert repo._currentlock(repo._lockref) is None
21 testing.wait_file(WALKED_FILE_2)
22
23
24 def uisetup(ui):
25 extensions.wrapfunction(
26 streamclone, '_test_sync_point_walk_1', _test_sync_point_walk_1
27 )
28
29 extensions.wrapfunction(
30 streamclone, '_test_sync_point_walk_2', _test_sync_point_walk_2
31 )