diff options
| author | Gavin Mak <gavinmak@google.com> | 2025-08-13 22:48:36 -0700 |
|---|---|---|
| committer | Gavin Mak <gavinmak@google.com> | 2025-08-13 23:17:56 -0700 |
| commit | a64149a7a77814132629bbb4c07d922c2222df25 (patch) | |
| tree | be39644559d35dab72d9f7d19e9115c0ccf3e1fd /tests | |
| parent | 3e6acf2778b533aedb2a1f6f6e3a3159e0b8c86d (diff) | |
| download | git-repo-a64149a7a77814132629bbb4c07d922c2222df25.tar.gz | |
sync: Record and propagate errors from deferred actions
Failures in deferred sync actions were not recorded because `_Later.Run`
discarded the `GitError` exception. Record the specific error using
`syncbuf.fail()` and propagate it for proper error aggregation and
reporting.
Bug: 438178765
Change-Id: Iad59e389f9677bd6b8d873ee1ea2aa6ce44c86fa
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/498141
Tested-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Scott Lee <ddoman@google.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_subcmds_sync.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_subcmds_sync.py b/tests/test_subcmds_sync.py index 5955e404..940c69fc 100644 --- a/tests/test_subcmds_sync.py +++ b/tests/test_subcmds_sync.py | |||
| @@ -801,6 +801,7 @@ class InterleavedSyncTest(unittest.TestCase): | |||
| 801 | with mock.patch("subcmds.sync.SyncBuffer") as mock_sync_buffer: | 801 | with mock.patch("subcmds.sync.SyncBuffer") as mock_sync_buffer: |
| 802 | mock_sync_buf_instance = mock.MagicMock() | 802 | mock_sync_buf_instance = mock.MagicMock() |
| 803 | mock_sync_buf_instance.Finish.return_value = True | 803 | mock_sync_buf_instance.Finish.return_value = True |
| 804 | mock_sync_buf_instance.errors = [] | ||
| 804 | mock_sync_buffer.return_value = mock_sync_buf_instance | 805 | mock_sync_buffer.return_value = mock_sync_buf_instance |
| 805 | 806 | ||
| 806 | result_obj = self.cmd._SyncProjectList(opt, [0]) | 807 | result_obj = self.cmd._SyncProjectList(opt, [0]) |
| @@ -909,6 +910,7 @@ class InterleavedSyncTest(unittest.TestCase): | |||
| 909 | with mock.patch("subcmds.sync.SyncBuffer") as mock_sync_buffer: | 910 | with mock.patch("subcmds.sync.SyncBuffer") as mock_sync_buffer: |
| 910 | mock_sync_buf_instance = mock.MagicMock() | 911 | mock_sync_buf_instance = mock.MagicMock() |
| 911 | mock_sync_buf_instance.Finish.return_value = True | 912 | mock_sync_buf_instance.Finish.return_value = True |
| 913 | mock_sync_buf_instance.errors = [] | ||
| 912 | mock_sync_buffer.return_value = mock_sync_buf_instance | 914 | mock_sync_buffer.return_value = mock_sync_buf_instance |
| 913 | 915 | ||
| 914 | result_obj = self.cmd._SyncProjectList(opt, [0]) | 916 | result_obj = self.cmd._SyncProjectList(opt, [0]) |
