Skip to content

fix(test): prevent cleanup failures from failing passing tests#13261

Draft
hbelmiro wants to merge 4 commits intokubeflow:masterfrom
hbelmiro:fix-flakyness
Draft

fix(test): prevent cleanup failures from failing passing tests#13261
hbelmiro wants to merge 4 commits intokubeflow:masterfrom
hbelmiro:fix-flakyness

Conversation

@hbelmiro
Copy link
Copy Markdown
Contributor

Description of your changes:

  • Remove gomega.Expect assertions from DeletePipeline and DeleteAllPipelines so cleanup errors no longer fail passing tests. This matches the pattern used by DeletePipelineRun, TerminatePipelineRun, and DeleteExperiment.
  • Add DeleteAllPipelines in BeforeEach for the Pagination and Sorting pipeline list test contexts to prevent false positives from leftover pipelines satisfying loose >= count assertions.

Checklist:

Copilot AI review requested due to automatic review settings April 13, 2026 14:00
@google-oss-prow google-oss-prow bot requested review from HumairAK and gmfrasca April 13, 2026 14:00
@google-oss-prow
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 ask for approval from hbelmiro. For more information see the Kubernetes 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

Copy link
Copy Markdown
Contributor

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 adjusts backend integration test utilities and pipeline list API tests to reduce false failures from cleanup logic and to avoid false positives caused by leftover pipelines affecting list assertions.

Changes:

  • Removes gomega.Expect assertions from DeletePipeline / DeleteAllPipelines so cleanup errors don’t fail otherwise-passing tests.
  • Adds DeleteAllPipelines in BeforeEach for Pagination and Sorting list-pipelines contexts to reduce flakiness from leftover pipelines.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
backend/test/v2/api/pipeline_api_test.go Adds pre-test cleanup in pagination/sorting contexts to reduce leftover-resource interference.
backend/test/testutil/pipeline_utils.go Makes pipeline cleanup best-effort by removing failing assertions during deletion.

Comment thread backend/test/testutil/pipeline_utils.go Outdated
Comment thread backend/test/v2/api/pipeline_api_test.go Outdated
Comment thread backend/test/v2/api/pipeline_api_test.go Outdated
Copy link
Copy Markdown
Contributor

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

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

Comment thread backend/test/testutil/pipeline_utils.go
@hbelmiro hbelmiro marked this pull request as draft April 13, 2026 15:26
@hbelmiro hbelmiro marked this pull request as ready for review April 13, 2026 16:52
@google-oss-prow google-oss-prow bot requested a review from nsingla April 13, 2026 16:52
Comment thread backend/test/testutil/pipeline_utils.go Outdated
logger.Log("Deleting all pipeline version of pipeline with id=%s", pipelineID)
DeleteAllPipelineVersions(client, pipelineID)
logger.Log("Deleting pipeline with id=%s", pipelineID)
err = client.Delete(&pipeline_params.PipelineServiceDeletePipelineParams{PipelineID: pipelineID})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would the in here execute if the pipeline doesn't exist, and if does exist, then we should be able to delete it, if not, then there probably is an issue somewhere. I don't agree with the following log statement and exiting without hard failure

Comment thread backend/test/testutil/pipeline_utils.go Outdated
}

/* DeleteAllPipelines deletes all pipelines */
func DeleteAllPipelines(client *api_server.PipelineClient, namespace *string) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't think of an exact scenario on top of my head, but I think the reason why we had the logic before was to prevent some issues with parallel execution with some tests creating and deleting pipeline within the test body vs AfterEach or AfterAll

@hbelmiro hbelmiro marked this pull request as draft April 13, 2026 18:38
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
…y pipeline list assertions

Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
…tion and sorting tests

Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
…n cleanup logic

- Updated `DeletePipeline` to support cascade deletions by passing a `cascade` flag.
- Refactored tests to use cascade deletion for improved cleanup consistency and reliability.

Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
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.

3 participants