This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new bbea0f03 fix: Hive catalog test failure on CPython 3.13.12 (#3043)
bbea0f03 is described below
commit bbea0f0342b971ba7336a29e4b884816b8cfc832
Author: geruh <[email protected]>
AuthorDate: Sun Feb 15 13:07:58 2026 -0800
fix: Hive catalog test failure on CPython 3.13.12 (#3043)
# Rationale for this change
While reviewing some open PRs #3041, #3042, I noticed CI kept failing on
the Python 3.13 job in the hive tests. Turns out [CPython 3.13.12
](https://docs.python.org/3.13/whatsnew/changelog.html#id3)was just
released and included a change
https://github.com/python/cpython/issues/142651 which made
`Mock.call_count` thread-safe by deriving it from `len(call_args_list)`.
This broke our hive test, which was resetting the counter with
`mock.call_count = 0` directly. This switches to use reset_mock(), which
properly clears all the internal call tracking state.
## Are these changes tested?
`make test` passes
## Are there any user-facing changes?
no
---
tests/catalog/test_hive.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/catalog/test_hive.py b/tests/catalog/test_hive.py
index 88b653e4..a8c0c943 100644
--- a/tests/catalog/test_hive.py
+++ b/tests/catalog/test_hive.py
@@ -1314,8 +1314,8 @@ def test_hive_wait_for_lock() -> None:
assert catalog._client.check_lock.call_count == 3
# lock wait should exit with WaitingForLockException finally after enough
retries
+ catalog._client.check_lock.reset_mock()
catalog._client.check_lock.side_effect = [waiting for _ in range(10)]
- catalog._client.check_lock.call_count = 0
with pytest.raises(WaitingForLockException):
catalog._wait_for_lock("db", "tbl", lockid, catalog._client)
assert catalog._client.check_lock.call_count == 5