From 23619a90a2d6999e528bc0525889033afc9763ca Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 29 Jul 2026 10:09:14 +0300 Subject: [PATCH 1/9] more logging for the metrics test --- tests/unit/metrics/metrics_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unit/metrics/metrics_test.py b/tests/unit/metrics/metrics_test.py index a2be7543c5..0b2b949678 100644 --- a/tests/unit/metrics/metrics_test.py +++ b/tests/unit/metrics/metrics_test.py @@ -49,8 +49,16 @@ def test_compatibility(self): ), 2147483647, ) - actual_blob = compressor.generate_blob() + print("==== EXPECTED BLOB ====") + for i, x in enumerate(expected_blob): + print(i, x) + print("-----------------------") + print("==== ACTUAL BLOB ====") + for i, x in enumerate(actual_blob): + print(i, x) + print("-----------------------") + self.assertEqual(expected_blob, actual_blob) From c01fecdceb72e9e2e18a244c56d5c5af00460d52 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 29 Jul 2026 11:21:15 +0300 Subject: [PATCH 2/9] try with downgrading psutil --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 7bd4c6b680..665293afd6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ thrift==0.24.0 -psutil>=7.2.2 +psutil>=5.8.0 mock==5.2.0 parameterized==0.9.0 pytest-cov==7.1.0 \ No newline at end of file From af95a3713839c2709132eba5d3897f3d53f462f3 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 29 Jul 2026 15:45:03 +0300 Subject: [PATCH 3/9] up --- hazelcast/metrics.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hazelcast/metrics.py b/hazelcast/metrics.py index 9a6305a325..d108f2ba20 100644 --- a/hazelcast/metrics.py +++ b/hazelcast/metrics.py @@ -258,6 +258,7 @@ def _get_dict_id(self, word): def _write_metrics_dict(self): words = self._metrics_dict.get_words() + print("\n\n:", len(words), "words:", words) self._dict_buf.write_int(len(words)) last_word_text = "" @@ -353,6 +354,9 @@ def __init__(self, word, dict_id): self.word = word self.dict_id = dict_id + def __repr__(self) -> str: + return f"" + class _MetricsDictionary: """Stores word -> id mappings. From a804b7d6850f3019a9d40fab24742a289ba24be8 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 30 Jul 2026 09:40:25 +0300 Subject: [PATCH 4/9] up --- hazelcast/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hazelcast/metrics.py b/hazelcast/metrics.py index d108f2ba20..9f80d34c24 100644 --- a/hazelcast/metrics.py +++ b/hazelcast/metrics.py @@ -170,6 +170,7 @@ def add_double(self, descriptor, value): def generate_blob(self): self._write_metrics_dict() metrics_buf = self._metrics_buf.compress() + print("\n\n=== len(dict_buf) = ", len(self._dict_buf.to_bytearray()), "\n") dict_buf = self._dict_buf.compress() complete_size = ( @@ -258,7 +259,6 @@ def _get_dict_id(self, word): def _write_metrics_dict(self): words = self._metrics_dict.get_words() - print("\n\n:", len(words), "words:", words) self._dict_buf.write_int(len(words)) last_word_text = "" From b480292c0d68c3078d314cf2f45c19236468a6d6 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 30 Jul 2026 10:34:44 +0300 Subject: [PATCH 5/9] up --- hazelcast/metrics.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hazelcast/metrics.py b/hazelcast/metrics.py index 9f80d34c24..d0edb671b2 100644 --- a/hazelcast/metrics.py +++ b/hazelcast/metrics.py @@ -172,6 +172,7 @@ def generate_blob(self): metrics_buf = self._metrics_buf.compress() print("\n\n=== len(dict_buf) = ", len(self._dict_buf.to_bytearray()), "\n") dict_buf = self._dict_buf.compress() + print("\n\n=== len(dict_buf) AC = ", len(dict_buf), "\n") complete_size = ( _SIZE_VERSION From 3605bcc041ff14ee4284f7d1eb8aba4f91ccbad2 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 30 Jul 2026 11:44:42 +0300 Subject: [PATCH 6/9] fix metrics_test for Win + Py 3.14 --- hazelcast/metrics.py | 5 ----- requirements-test.txt | 2 +- tests/unit/metrics/metrics_test.py | 12 +++--------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/hazelcast/metrics.py b/hazelcast/metrics.py index d0edb671b2..9a6305a325 100644 --- a/hazelcast/metrics.py +++ b/hazelcast/metrics.py @@ -170,9 +170,7 @@ def add_double(self, descriptor, value): def generate_blob(self): self._write_metrics_dict() metrics_buf = self._metrics_buf.compress() - print("\n\n=== len(dict_buf) = ", len(self._dict_buf.to_bytearray()), "\n") dict_buf = self._dict_buf.compress() - print("\n\n=== len(dict_buf) AC = ", len(dict_buf), "\n") complete_size = ( _SIZE_VERSION @@ -355,9 +353,6 @@ def __init__(self, word, dict_id): self.word = word self.dict_id = dict_id - def __repr__(self) -> str: - return f"" - class _MetricsDictionary: """Stores word -> id mappings. diff --git a/requirements-test.txt b/requirements-test.txt index 665293afd6..7bd4c6b680 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ thrift==0.24.0 -psutil>=5.8.0 +psutil>=7.2.2 mock==5.2.0 parameterized==0.9.0 pytest-cov==7.1.0 \ No newline at end of file diff --git a/tests/unit/metrics/metrics_test.py b/tests/unit/metrics/metrics_test.py index 0b2b949678..336860ddc9 100644 --- a/tests/unit/metrics/metrics_test.py +++ b/tests/unit/metrics/metrics_test.py @@ -1,3 +1,4 @@ +import sys import unittest from os import path @@ -50,15 +51,8 @@ def test_compatibility(self): 2147483647, ) actual_blob = compressor.generate_blob() - print("==== EXPECTED BLOB ====") - for i, x in enumerate(expected_blob): - print(i, x) - print("-----------------------") - print("==== ACTUAL BLOB ====") - for i, x in enumerate(actual_blob): - print(i, x) - print("-----------------------") - + if sys.version_info.major == 3 and sys.version_info.minor > 13 and sys.platform == 'windows': + self.skipTest("Python 3.14 and up on Windows uses zlib-ng instead of zlib, which ends up with a different payload") self.assertEqual(expected_blob, actual_blob) From 11f2e543bbe2c87fea2b089a1c343f98d2fc8c95 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 30 Jul 2026 11:50:53 +0300 Subject: [PATCH 7/9] black --- tests/unit/metrics/metrics_test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/unit/metrics/metrics_test.py b/tests/unit/metrics/metrics_test.py index 336860ddc9..5932f09c28 100644 --- a/tests/unit/metrics/metrics_test.py +++ b/tests/unit/metrics/metrics_test.py @@ -51,8 +51,14 @@ def test_compatibility(self): 2147483647, ) actual_blob = compressor.generate_blob() - if sys.version_info.major == 3 and sys.version_info.minor > 13 and sys.platform == 'windows': - self.skipTest("Python 3.14 and up on Windows uses zlib-ng instead of zlib, which ends up with a different payload") + if ( + sys.version_info.major == 3 + and sys.version_info.minor > 13 + and sys.platform == "windows" + ): + self.skipTest( + "Python 3.14 and up on Windows uses zlib-ng instead of zlib, which ends up with a different payload" + ) self.assertEqual(expected_blob, actual_blob) From f1993d1476a7cc71ee9a518d710bf771019c16b2 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 30 Jul 2026 12:16:22 +0300 Subject: [PATCH 8/9] fix sys.platform --- tests/unit/metrics/metrics_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/metrics/metrics_test.py b/tests/unit/metrics/metrics_test.py index 5932f09c28..168979e589 100644 --- a/tests/unit/metrics/metrics_test.py +++ b/tests/unit/metrics/metrics_test.py @@ -52,9 +52,9 @@ def test_compatibility(self): ) actual_blob = compressor.generate_blob() if ( - sys.version_info.major == 3 + sys.platform == "win32" and sys.version_info.minor > 13 - and sys.platform == "windows" + and sys.version_info.major == 3 ): self.skipTest( "Python 3.14 and up on Windows uses zlib-ng instead of zlib, which ends up with a different payload" From 5a4e66bcf8222dd1ffd721e590dfa0d433be5487 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 30 Jul 2026 12:24:36 +0300 Subject: [PATCH 9/9] black --- tests/unit/metrics/metrics_test.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/unit/metrics/metrics_test.py b/tests/unit/metrics/metrics_test.py index 168979e589..063e8241dc 100644 --- a/tests/unit/metrics/metrics_test.py +++ b/tests/unit/metrics/metrics_test.py @@ -51,11 +51,7 @@ def test_compatibility(self): 2147483647, ) actual_blob = compressor.generate_blob() - if ( - sys.platform == "win32" - and sys.version_info.minor > 13 - and sys.version_info.major == 3 - ): + if sys.platform == "win32" and sys.version_info.minor > 13 and sys.version_info.major == 3: self.skipTest( "Python 3.14 and up on Windows uses zlib-ng instead of zlib, which ends up with a different payload" )