Skip to content

Commit 9e2d738

Browse files
committed
rename python script
1 parent 202e25f commit 9e2d738

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

tests/templates/kuttl/client-spooling/04-copy-scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ apiVersion: kuttl.dev/v1beta1
33
kind: TestStep
44
commands:
55
- script: kubectl cp -n $NAMESPACE ../../../../templates/kuttl/commons/check-active-workers.py trino-test-helper:/tmp || true
6-
- script: kubectl cp -n $NAMESPACE 04_check-fte.py trino-test-helper:/tmp/
6+
- script: kubectl cp -n $NAMESPACE 04_query.py trino-test-helper:/tmp/

tests/templates/kuttl/client-spooling/04_check-fte.py renamed to tests/templates/kuttl/client-spooling/04_query.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ def get_connection(coordinator):
3838
try:
3939
cursor = conn.cursor()
4040

41+
# The table tpch.sf100.customer has 15 million rows but Python consumes
42+
# too much memory to retrieve all of them at once.
43+
# Fetching them one by one is too slow, so we fetch only 10k rows which seems to be enough
44+
# for Trino to use the spooling protocol.
45+
# Fetching less rows is too risky IMO as Trino might decide to not use spooling.
46+
4147
print("🚜 fetching many rows from Trino to trigger spooling...")
4248

4349
cursor.execute("SELECT * FROM tpch.sf100.customer")
@@ -48,7 +54,10 @@ def get_connection(coordinator):
4854
cursor.fetchmany(1_000)
4955
customer_count += 1_000
5056
batch = batch - 1
51-
# assert customer_count == 15_000_000, f"TPCH test failed: expected 15 mil customers, got {customer_count}"
57+
58+
assert customer_count == 10_000, (
59+
f"💀 crap! expected 10_000 customers, got {customer_count}"
60+
)
5261

5362
print("🎉 major success!")
5463

tests/templates/kuttl/client-spooling/05-run-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ apiVersion: kuttl.dev/v1beta1
33
kind: TestStep
44
commands:
55
- script: kubectl exec -n $NAMESPACE trino-test-helper -- pip install --no-cache-dir trino==0.336.0
6-
- script: kubectl exec -n $NAMESPACE trino-test-helper -- python /tmp/04_check-fte.py -c trino-coordinator
6+
- script: kubectl exec -n $NAMESPACE trino-test-helper -- python /tmp/04_query.py -c trino-coordinator
77
timeout: 120

0 commit comments

Comments
 (0)