diff options
author | Gavin Mak <gavinmak@google.com> | 2025-10-20 11:13:09 -0700 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-10-20 11:28:21 -0700 |
commit | 1afe96a7e997ce7748f066b206a85ac648f7a87c (patch) | |
tree | 69f31057506ad29f5e415819b52decf577960469 /tests/test_subcmds_sync.py | |
parent | 2719a8e203e43b34a437b510092758870b81cae6 (diff) | |
download | git-repo-1afe96a7e997ce7748f066b206a85ac648f7a87c.tar.gz |
Interleaved sync didn't save _fetch_times and _local_sync_state to disk.
Phased sync saved them, but incorrectly applied moving average smoothing
repeatedly when fetching submodules, and discarded historical data
during partial syncs.
Move .Save() calls to the end of main sync loops to ensure they run
once. Update _FetchTimes.Save() to merge new data with existing history,
preventing data loss.
Change-Id: I174f98a62ac86859f1eeea1daba65eb35c227852
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/519821
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Scott Lee <ddoman@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'tests/test_subcmds_sync.py')
-rw-r--r-- | tests/test_subcmds_sync.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_subcmds_sync.py b/tests/test_subcmds_sync.py index 6c9cc9ab..6eb8a5a7 100644 --- a/tests/test_subcmds_sync.py +++ b/tests/test_subcmds_sync.py | |||
@@ -681,6 +681,9 @@ class InterleavedSyncTest(unittest.TestCase): | |||
681 | # Mock _GetCurrentBranchOnly for worker tests. | 681 | # Mock _GetCurrentBranchOnly for worker tests. |
682 | mock.patch.object(sync.Sync, "_GetCurrentBranchOnly").start() | 682 | mock.patch.object(sync.Sync, "_GetCurrentBranchOnly").start() |
683 | 683 | ||
684 | self.cmd._fetch_times = mock.Mock() | ||
685 | self.cmd._local_sync_state = mock.Mock() | ||
686 | |||
684 | def tearDown(self): | 687 | def tearDown(self): |
685 | """Clean up resources.""" | 688 | """Clean up resources.""" |
686 | shutil.rmtree(self.repodir) | 689 | shutil.rmtree(self.repodir) |