Skip to content

fix: avoid e2e teardown panic after setup failure#2231

Merged
AndrewChubatiuk merged 1 commit into
VictoriaMetrics:masterfrom
immanuwell:fix/e2e-shutdown-panic
Jun 1, 2026
Merged

fix: avoid e2e teardown panic after setup failure#2231
AndrewChubatiuk merged 1 commit into
VictoriaMetrics:masterfrom
immanuwell:fix/e2e-shutdown-panic

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

@immanuwell immanuwell commented May 31, 2026

ShutdownOperatorProcess() can panic if suite startup exits before cancelManager is set. Then the real setup error gets buried, kinda noisy.

This just guards the "manager never started" path and adds a small regression test.

Repro

  1. Point kubeconfig at an unreachable or not ready cluster.
  2. Run go test ./test/e2e -run TestE2E.
  3. Before this patch, SynchronizedBeforeSuite fails and SynchronizedAfterSuite panics on nil cancelManager.
  4. After this patch, you only get the original setup failure.

Summary by cubic

Prevent e2e teardown panics when setup fails by safely handling cases where the operator manager never started. Teardown now skips manager shutdown and surfaces the original setup error.

  • Bug Fixes
    • Guard manager shutdown: only call cancel and wait if the manager was initialized.
    • Add a regression test to ensure teardown does not panic when the manager never started.

Written for commit 3462f93. Summary will update on new commits.

Review in cubic

Signed-off-by: immanuwell <pchpr.00@list.ru>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for contribution

@AndrewChubatiuk AndrewChubatiuk merged commit f57a9ec into VictoriaMetrics:master Jun 1, 2026
3 checks passed
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