File tree Expand file tree Collapse file tree
tests/templates/kuttl/fault-tolerant-execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22apiVersion : kuttl.dev/v1beta1
33kind : TestStep
44commands :
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/
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 22apiVersion : kuttl.dev/v1beta1
33kind : TestStep
44commands :
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
You can’t perform that action at this time.
0 commit comments