Skip to content

Commit 657ca0a

Browse files
committed
Update tests
Signed-off-by: Matt Lord <mattalord@gmail.com>
1 parent e9cf734 commit 657ca0a

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

test/endtoend/backup_restore_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cd test/endtoend/operator || exit 1
3131
get_started "operator-latest.yaml" "101_initial_cluster_backup.yaml"
3232
verifyVtGateVersion "24.0.0"
3333
checkSemiSyncSetup
34+
checkMysqldExporterMetrics
3435
takeBackup "commerce/-"
3536
verifyListBackupsOutput
3637
takedownShard

test/endtoend/backup_schedule_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ cd test/endtoend/operator || exit 1
3434
get_started "operator-latest.yaml" "101_initial_cluster_backup_schedule.yaml"
3535
verifyVtGateVersion "24.0.0"
3636
checkSemiSyncSetup
37+
checkMysqldExporterMetrics
3738
verifyListBackupsOutputWithSchedule
3839

3940
# Teardown

test/endtoend/hpa_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ get_started "operator-latest.yaml" "101_initial_cluster_autoscale.yaml"
3737
verifyVtGateVersion "24.0.0"
3838
checkSemiSyncSetup
3939

40+
checkMysqldExporterMetrics
4041
verifyHpaCount 0
4142

4243
echo "Apply cluster_autoscale.yaml"

test/endtoend/utils.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,3 +517,15 @@ function checkVitessBackupScheduleStatusWithTimeout() {
517517
echo -e "ERROR: checkPodStatusWithTimeout timeout to find pod matching:\ngot:\n$out\nfor regex: $regex"
518518
exit 1
519519
}
520+
521+
function checkMysqldExporterMetrics() {
522+
for vttablet in $(kubectl get pods -n example --no-headers -o custom-columns=":metadata.name" | grep "vttablet") ; do
523+
echo "Confirming that the mysqld_exporter is working in ${vttablet}"
524+
open_files=$(kubectl -n example exec -it "${vttablet}" -c vttablet -- curl localhost:9104/metrics | grep -E "^mysql_global_status_open_files" | awk '{print $2}' | bc)
525+
if [[ ${open_files} -lt 1 ]]; then
526+
echo -e "ERROR: mysqld metrics do not appear to be successfully exported from the ${vttablet} pod (open_files result: ${open_files})"
527+
exit 1
528+
fi
529+
echo "Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = ${open_files}"
530+
done
531+
}

0 commit comments

Comments
 (0)