Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix intermittent cron failures due to parallelism limit #14218

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MasonM
Copy link
Member

@MasonM MasonM commented Feb 23, 2025

Motivation

Occasionally, the cron E2E suite fails and you'll see the following in the output (example):

◷ test-cron-wf-fail-1-1740291060 Workflow 0s Workflow processing has been postponed because too many workflows are already running

I think this is happening because the E2ESuite.DeleteResources() method that's supposed to clean up CronWorkflows from previous tests isn't being run for subtests, and nearly all the tests in test/e2e/cron_test.go are subtests.

Modifications

This adds a TearDownSubTest method to cleanup all resources after every subtest. Docs:
https://pkg.go.dev/github.com/stretchr/testify/suite#TearDownSubTest

I also deleted the redundant BeforeTest() and TearDownSuite() methods.

Verification

Ran make test-cron locally

Occasionally, the cron E2E suite fails and you'll see the following in
the output (example:
https://github.com/argoproj/argo-workflows/actions/runs/13480065787/job/37664515754?pr=13747):
>  ◷ test-cron-wf-fail-1-1740291060 Workflow 0s      Workflow processing has been postponed because too many workflows are already running

i think this is happening because the `E2ESuite.DeleteResources()`
method that's supposed to clean up `CronWorkflow`s from previous tests
isn't being run for subtests, and nearly all the tests in
`test/e2e/cron_test.go` are subtests. This adds a `TearDownSubTest`
method to do so. Docs:
https://pkg.go.dev/github.com/stretchr/testify/suite#TearDownSubTest

I also deleted the redundant `BeforeTest()` and `TearDownSuite()` methods.

Signed-off-by: Mason Malone <[email protected]>
@MasonM MasonM marked this pull request as ready for review February 23, 2025 20:24
@MasonM MasonM requested a review from isubasinghe February 23, 2025 20:24
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