Skip to content

K8SPG-943: check operator panic in e2e test#1441

Draft
mayankshah1607 wants to merge 2 commits intomainfrom
K8SPG-943-e2e-test
Draft

K8SPG-943: check operator panic in e2e test#1441
mayankshah1607 wants to merge 2 commits intomainfrom
K8SPG-943-e2e-test

Conversation

@mayankshah1607
Copy link
Member

CHANGE DESCRIPTION

Problem:
Short explanation of the problem.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copilot AI review requested due to automatic review settings February 13, 2026 09:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds operator panic detection to E2E test cleanup phases. The change introduces a new check_operator_panic function that searches operator logs for panic messages and calls this function before destroying the operator in test cleanup scripts.

Changes:

  • Added check_operator_panic function to e2e-tests/functions that checks operator logs for "Observed a panic" messages
  • Updated 29 E2E test cleanup files to call check_operator_panic before destroy_operator

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

File Description
e2e-tests/functions Adds new check_operator_panic function to detect panics in operator logs
e2e-tests/tests//99-.yaml Updates 29 test cleanup scripts to check for operator panics before destroying the operator

Comment on lines +40 to +46
check_operator_panic() {
local operator_pod=$(get_operator_pod)
if kubectl logs -n "${OPERATOR_NS:-$NAMESPACE}" "$operator_pod" -c operator | grep -q "Observed a panic"; then
echo "Detected panic in operator"
exit 1
fi
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function doesn't verify that the operator pod exists before checking for panics. If get_operator_pod returns an empty string (no operator pod found), the kubectl logs command will fail, but the error will be masked by the pipeline to grep, causing the function to silently succeed without checking for panics.

Add validation that operator_pod is non-empty before attempting to retrieve logs. Consider also handling the case where kubectl logs fails due to the pod not existing or not being ready yet.

Copilot uses AI. Check for mistakes.
@JNKPercona
Copy link
Collaborator

Test Name Result Time
backup-enable-disable passed 00:05:49
builtin-extensions passed 00:05:11
custom-envs passed 00:18:02
custom-extensions passed 00:12:46
custom-tls passed 00:05:03
database-init-sql passed 00:03:06
demand-backup passed 00:22:24
finalizers failure 00:03:50
init-deploy passed 00:02:48
huge-pages passed 00:03:11
monitoring passed 00:06:51
monitoring-pmm3 passed 00:07:48
one-pod passed 00:05:21
operator-self-healing passed 00:08:14
pitr passed 00:11:22
scaling passed 00:05:09
scheduled-backup passed 00:26:27
self-healing passed 00:08:59
sidecars passed 00:02:30
standby-pgbackrest passed 00:11:44
standby-streaming passed 00:09:10
start-from-backup passed 00:10:15
tablespaces passed 00:06:53
telemetry-transfer passed 00:03:40
upgrade-consistency passed 00:06:11
upgrade-minor passed 00:06:03
users passed 00:04:28
Summary Value
Tests Run 27/27
Job Duration 01:23:19
Total Test Time 03:43:29

commit: 6fa21f8
image: perconalab/percona-postgresql-operator:PR-1441-6fa21f846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants