Skip to content

Commit cef8eac

Browse files
committed
fix: integration test fixes
1 parent 684083c commit cef8eac

3 files changed

Lines changed: 6 additions & 27 deletions

File tree

tests/templates/kuttl/fault-tolerant-execution/04-copy-scripts.yaml

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

tests/templates/kuttl/fault-tolerant-execution/04_check-fte.py

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,14 @@ def get_connection(coordinator):
2727
required=True,
2828
help="Trino Coordinator Host to connect to",
2929
)
30-
all_args.add_argument(
31-
"-w",
32-
"--workers",
33-
required=True,
34-
help="Expected amount of workers to be present",
35-
)
3630

3731
args = vars(all_args.parse_args())
3832

39-
expected_workers = args["workers"]
4033
conn = get_connection(args["coordinator"])
4134

4235
try:
4336
cursor = conn.cursor()
4437

45-
# Check that workers are active
46-
cursor.execute(
47-
"SELECT COUNT(*) as nodes FROM system.runtime.nodes WHERE coordinator=false AND state='active'"
48-
)
49-
(active_workers,) = cursor.fetchone()
50-
51-
if int(active_workers) != int(expected_workers):
52-
print(
53-
"Mismatch: [expected/active] workers ["
54-
+ str(expected_workers)
55-
+ "/"
56-
+ str(active_workers)
57-
+ "]"
58-
)
59-
exit(-1)
60-
61-
print(f"Active workers check passed: {active_workers}/{expected_workers}")
62-
6338
# Test that TPCH connector is working
6439
cursor.execute("SELECT COUNT(*) FROM tpch.tiny.nation")
6540
result = cursor.fetchone()
@@ -90,6 +65,9 @@ def get_connection(coordinator):
9065

9166
print("Complex query test passed")
9267

68+
cursor.close()
69+
conn.close()
70+
9371
except Exception as e:
9472
print(f"Test failed with error: {e}")
9573
import traceback

tests/templates/kuttl/fault-tolerant-execution/05-run-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
apiVersion: kuttl.dev/v1beta1
33
kind: TestStep
44
commands:
5-
- script: kubectl exec -n $NAMESPACE trino-test-helper-0 -- python /tmp/04_check-fte.py -c trino-fte-coordinator -w 2
5+
- script: kubectl exec -n $NAMESPACE trino-test-helper-0 -- python /tmp/check-active-workers.py -u admin -p "" -c trino-fte-coordinator -w 2
6+
- script: kubectl exec -n $NAMESPACE trino-test-helper-0 -- python /tmp/04_check-fte.py -c trino-fte-coordinator
67
timeout: 120
78
# Verify that the exchange bucket contains data
89
- script: |
9-
sleep 10
1010
kubectl exec -n $NAMESPACE deployment/minio -- mc alias set local https://localhost:9000 minioAccessKey minioSecretKey --api S3v4
1111
count=$(kubectl exec -n $NAMESPACE deployment/minio -- mc stat --insecure local/exchange-bucket | awk '/Objects count:/ {print $3}')
1212
if [ "$count" -gt 0 ]; then

0 commit comments

Comments
 (0)