diff options
author | azevaykin <145343289+azevaykin@users.noreply.github.com> | 2025-07-30 17:41:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-30 14:41:31 +0000 |
commit | 4bb1e40049b467c1214fda4f0b83e7b8c83c4620 (patch) | |
tree | 9beab920ecc9e5d9d0b1142702af7242d42c25b7 | |
parent | accb32b612fc25e688f62ee7ed7918087275191e (diff) | |
download | ydb-4bb1e40049b467c1214fda4f0b83e7b8c83c4620.tar.gz |
Add check_statistics to test (#21974)
-rw-r--r-- | ydb/tests/compatibility/test_followers.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ydb/tests/compatibility/test_followers.py b/ydb/tests/compatibility/test_followers.py index 1298d4c904f..02d476d128b 100644 --- a/ydb/tests/compatibility/test_followers.py +++ b/ydb/tests/compatibility/test_followers.py @@ -195,6 +195,27 @@ class TestSecondaryIndexFollowers(RollingUpgradeAndDowngradeFixture): with ydb.QuerySessionPool(self.driver) as session_pool: session_pool.retry_operation_sync(operation) + def check_statistics(self, enable_followers): + queries = [ + f""" + SELECT * + FROM `/Root/.sys/partition_stats` + WHERE + (RowReads != 0 OR RangeReads != 0) + AND Path = '/Root/{self.TABLE_NAME}/{self.INDEX_NAME}/indexImplTable' + """ + ] + + with ydb.QuerySessionPool(self.driver) as session_pool: + for _ in range(self.ATTEMPT_COUNT): + for query in queries: + result_sets = session_pool.execute_with_retries(query) + result_row_count = len(result_sets[0].rows) + if result_row_count > 0: + return + time.sleep(self.ATTEMPT_INTERVAL) + assert False, f"Expected reads but there is timeout waiting for read stats from '/Root/{self.TABLE_NAME}/{self.INDEX_NAME}/indexImplTable'" + @pytest.mark.parametrize("enable_followers", [True, False]) def test_secondary_index_followers(self, enable_followers): self.create_table(enable_followers) @@ -202,3 +223,4 @@ class TestSecondaryIndexFollowers(RollingUpgradeAndDowngradeFixture): for _ in self.roll(): self.write_data() self.read_data() + self.check_statistics(enable_followers) |