diff mercurial/streamclone.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 6085b7f1536d
children aed6ceaad6d7
line wrap: on
line diff
--- a/mercurial/streamclone.py	Mon Apr 19 19:10:49 2021 +0200
+++ b/mercurial/streamclone.py	Mon Apr 19 19:12:28 2021 +0200
@@ -247,6 +247,8 @@
             if size:
                 entries.append((name, size))
                 total_bytes += size
+        _test_sync_point_walk_1(repo)
+    _test_sync_point_walk_2(repo)
 
     repo.ui.debug(
         b'%d files, %d bytes to transfer\n' % (len(entries), total_bytes)
@@ -593,6 +595,14 @@
                 fp.close()
 
 
+def _test_sync_point_walk_1(repo):
+    """a function for synchronisation during tests"""
+
+
+def _test_sync_point_walk_2(repo):
+    """a function for synchronisation during tests"""
+
+
 def generatev2(repo, includes, excludes, includeobsmarkers):
     """Emit content for version 2 of a streaming clone.
 
@@ -635,6 +645,8 @@
         chunks = _emit2(repo, entries, totalfilesize)
         first = next(chunks)
         assert first is None
+        _test_sync_point_walk_1(repo)
+    _test_sync_point_walk_2(repo)
 
     return len(entries), totalfilesize, chunks