summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ydb/tests/compatibility/udf/test_datetime2.py42
-rw-r--r--ydb/tests/compatibility/udf/test_digest.py16
2 files changed, 39 insertions, 19 deletions
diff --git a/ydb/tests/compatibility/udf/test_datetime2.py b/ydb/tests/compatibility/udf/test_datetime2.py
index 02576c33f30..ff8fb387e35 100644
--- a/ydb/tests/compatibility/udf/test_datetime2.py
+++ b/ydb/tests/compatibility/udf/test_datetime2.py
@@ -230,20 +230,30 @@ class TestDatetime2(MixedClusterFixture):
query = self.generate_insert()
session_pool.execute_with_retries(query)
- # ---------------- SELECT ------------------
- queries = [
- self.q_split(),
- self.q_make(),
- self.q_get(),
- self.q_update(),
- self.q_to_from(),
- self.q_interval(),
- self.q_start_end(),
- self.q_shift(),
- self.q_format(),
- self.q_parse()
- ]
+ # ---------------- SELECT ------------------
+ queries = [
+ self.q_split(),
+ self.q_make(),
+ self.q_get(),
+ self.q_update(),
+ self.q_to_from(),
+ self.q_interval(),
+ self.q_start_end(),
+ self.q_shift(),
+ self.q_format(),
+ self.q_parse()
+ ]
- for query in queries:
- result = session_pool.execute_with_retries(query)
- assert len(result[0].rows) > 0
+ """
+ UDFs are compiled once on the node that initially receives the request.
+ The compiled UDF is then propagated to all other nodes. Executing the query a single time only verifies
+ compatibility in one direction—either from old to new or from new to old. Performing multiple retries
+ increases the likelihood that the UDF will be compiled on both the old and new versions, thereby improving coverage of compatibility testing.
+
+ Additionally, a session pool always sends requests to the same node. To ensure distribution across nodes, the session pool is recreated for each SELECT request.
+ """
+ for _ in range(10):
+ with ydb.QuerySessionPool(self.driver) as session_pool:
+ for query in queries:
+ result = session_pool.execute_with_retries(query)
+ assert len(result[0].rows) > 0
diff --git a/ydb/tests/compatibility/udf/test_digest.py b/ydb/tests/compatibility/udf/test_digest.py
index 81af87c5dfd..f63f68216e5 100644
--- a/ydb/tests/compatibility/udf/test_digest.py
+++ b/ydb/tests/compatibility/udf/test_digest.py
@@ -95,6 +95,16 @@ class TestDigest(MixedClusterFixture):
query = self.generate_insert()
session_pool.execute_with_retries(query)
- query = self.q_digest()
- result = session_pool.execute_with_retries(query)
- assert len(result[0].rows) > 0
+ query = self.q_digest()
+ """
+ UDFs are compiled once on the node that initially receives the request.
+ The compiled UDF is then propagated to all other nodes. Executing the query a single time only verifies
+ compatibility in one direction—either from old to new or from new to old. Performing multiple retries
+ increases the likelihood that the UDF will be compiled on both the old and new versions, thereby improving coverage of compatibility testing.
+
+ Additionally, a session pool always sends requests to the same node. To ensure distribution across nodes, the session pool is recreated for each SELECT request.
+ """
+ for _ in range(10):
+ with ydb.QuerySessionPool(self.driver) as session_pool:
+ result = session_pool.execute_with_retries(query)
+ assert len(result[0].rows) > 0