diff tests/testlib/ext-stream-clone-steps.py @ 52359:3f0cf7bb3086

stream: preserve volatile cache early Since cache file are not protected by the lock, their state might change between their initial detection, the computation of their size and they preservation by the VolatileManager. So we gather all theses step in a single one to avoid such race. This also handle disappearing cache file in the "copy/hardlink" clone cases.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 04 Dec 2024 23:31:46 +0100
parents 11484a19cd77
children
line wrap: on
line diff
--- a/tests/testlib/ext-stream-clone-steps.py	Wed Dec 04 17:13:39 2024 +0100
+++ b/tests/testlib/ext-stream-clone-steps.py	Wed Dec 04 23:31:46 2024 +0100
@@ -21,10 +21,17 @@
 )
 
 
+WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1']
+WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2']
 WALKED_FILE_3 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_3']
 WALKED_FILE_4 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_4']
 
 
+def _test_sync_point_walk_1_2(orig, repo):
+    testing.write_file(WALKED_FILE_1)
+    testing.wait_file(WALKED_FILE_2)
+
+
 def _test_sync_point_walk_3(orig, repo):
     testing.write_file(WALKED_FILE_3)
 
@@ -36,6 +43,10 @@
 
 def uisetup(ui):
     extensions.wrapfunction(
+        streamclone, '_test_sync_point_walk_1_2', _test_sync_point_walk_1_2
+    )
+
+    extensions.wrapfunction(
         streamclone, '_test_sync_point_walk_3', _test_sync_point_walk_3
     )