From a8bf0d867979f3367e0a40a77bcd77973a17c557 Mon Sep 17 00:00:00 2001 From: Drew Sessler Date: Mon, 16 Feb 2026 11:54:36 -0800 Subject: [PATCH] OTel kuttl test fix: add bad psql command to force an error and ensure there will be a postgres log to capture. --- .../e2e/otel-logging-and-metrics/22-assert-instance.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml b/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml index 226bcce3cd..60e5fe5694 100644 --- a/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml +++ b/testing/kuttl/e2e/otel-logging-and-metrics/22-assert-instance.yaml @@ -4,6 +4,8 @@ commands: # First, check that all containers in the instance pod are ready. # Then, grab the collector metrics output and check that a postgres # metric is present, as well as a patroni metric. +# Then use psql to run a bad command in the database to get an error +# and ensure that there is a postgres log to capture. # Then, check the collector logs for patroni, and postgres logs. # Finally, ensure the monitoring user exists and is configured. - script: | @@ -35,6 +37,8 @@ commands: exit 1 } + kubectl exec "${pod}" -n "${NAMESPACE}" -- psql -c "SHOW DOES_NOT_EXIST;" 2>/dev/null || true + logs=$(kubectl logs "${pod}" --namespace "${NAMESPACE}" -c collector | grep InstrumentationScope) { contains "${logs}" 'InstrumentationScope patroni'; } || { retry "patroni logs not found"