Skip to content

Commit 29292da

Browse files
committed
Update test calling count measurement
- comment @varmar05
1 parent efd7ed6 commit 29292da

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

mergin/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,3 +1538,5 @@ def sync_project(self, project_directory, progress_callback=None):
15381538
sleep(PUSH_ATTEMPT_WAIT)
15391539
continue
15401540
raise e
1541+
else:
1542+
server_conflict_attempts = 0

mergin/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def is_retryable_sync(self) -> bool:
8383
if self.is_blocking_sync() or self.is_rate_limit():
8484
return True
8585

86+
# Check retryable based on http error and message from v1 sync API endpoint
8687
if (
8788
self.http_error
8889
and self.detail

mergin/test/test_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,6 +3172,7 @@ def test_client_project_sync_retry(mc):
31723172
mock_push_project_finalize.side_effect = ClientError("test error")
31733173
with pytest.raises(ClientError, match="test error"):
31743174
mc.sync_project(project_dir)
3175+
assert mock_push_project_finalize.call_count == 1
31753176

31763177
with patch("mergin.client.push_project_finalize") as mock_push_project_finalize, patch(
31773178
"mergin.client.PUSH_ATTEMPTS", 2

0 commit comments

Comments
 (0)