Skip to content

chore(e2e): Use DeferCleanup instead of AfterEach cleanup in parallel tests 1-007 to 1-070 - #1538

Merged
jgwest merged 1 commit into
redhat-developer:masterfrom
Gabrielandre02:e2e-defercleanup-after-each-1
Nov 16, 2026
Merged

jgwest merged 1 commit into
redhat-developer:masterfrom
Gabrielandre02:e2e-defercleanup-after-each-1

Conversation

@Gabrielandre02

@Gabrielandre02 Gabrielandre02 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1464

In 7 parallel specs (1-007 namespace scoped install, 1-007 volume mounts, 1-008, 1-021, 1-029, 1-030, 1-070) the namespace cleanup func was kept in a spec variable and called from AfterEach. It is now registered with DeferCleanup right after the namespace is created, so setup and cleanup are collocated and the spec variable goes away.

AfterEach keeps only OutputDebugOnFail. DeferCleanup callbacks run after AfterEach, so the debug output is still printed before the namespace is deleted.

Left alone: specs changed by #1504, 1-040, 1-042, 1-083 kustomize, 1-121, 1-124, 1-133 and 1-141 (extra logic in AfterEach), and the sequential specs, where cleanup order relative to RestoreSubscriptionToDefault matters.

Independent of #1531 to #1537 and #1504.

Testing

go vet ./test/openshift/e2e/ginkgo/parallel/ is clean. E2E specs not run locally (no cluster).

@openshift-ci

openshift-ci Bot commented Nov 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign trdoyle81 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5fb7a03 and 98a28d5.

Files selected for processing: 7

  • test/openshift/e2e/ginkgo/parallel/1-007_validate_namespace_scoped_install_test.go
  • test/openshift/e2e/ginkgo/parallel/1-007_validate_volume_mounts_test.go
  • test/openshift/e2e/ginkgo/parallel/1-008_validate-custom-argocd-namespace_test.go
  • test/openshift/e2e/ginkgo/parallel/1-021_validate_rolebindings_test.go
  • test/openshift/e2e/ginkgo/parallel/1-029_validate_tls_secret_no_scale_test.go
  • test/openshift/e2e/ginkgo/parallel/1-030_validate_reencrypt_test.go
  • test/openshift/e2e/ginkgo/parallel/1-070_validate_config_management_plugin_test.go

@openshift-ci

openshift-ci Bot commented Nov 12, 2026

Copy link
Copy Markdown

Hi @Gabrielandre02. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

… tests 1-007 to 1-070

Refs redhat-developer#1464

Register the namespace cleanup with DeferCleanup right after the
namespace is created, instead of keeping the cleanup func in a spec
variable and calling it from AfterEach. The AfterEach keeps only the
OutputDebugOnFail call, which still runs before the namespace is deleted.

Signed-off-by: gabriel.carmo <admin@gabrielandre.com.br>
@Gabrielandre02
Gabrielandre02 force-pushed the e2e-defercleanup-after-each-1 branch from a154f72 to 98a28d5 Compare November 13, 2026 23:41
@jgwest

jgwest commented Nov 14, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@jgwest
jgwest merged commit 4b79c9e into redhat-developer:master Nov 16, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants