-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(test): prevent global BeforeEach/AfterEach registration and add detection #30635
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
base: main
Are you sure you want to change the base?
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Scheduling required tests: Scheduling tests matching the |
…etection When exutil.FixturePath() or exutil.NewCLI*() is called at package level (in a var declaration outside any function), it registers BeforeEach/AfterEach hooks at the root of the Ginkgo tree. This causes these hooks to run for EVERY SINGLE TEST in the suite, even when not needed, wasting CI resources and adding unnecessary test execution time. This PR fixes the remaining cases of package-level FixturePath() calls by converting them to lazy functions: - kernel/common.go: rtEnvFixture, rtPodFixture - postgresql_replica.go: postgreSQLEphemeralTemplate - mysql_replica.go: helperTemplate - networking/util.go: ipsecConfigurationBaseDir, nsMachineConfigFixture, nsNodeRebootNoneFixture Additionally, this PR adds runtime detection that creates flaky JUnit test cases when global nodes are detected. This allows CI to track future violations without blocking test runs. The detection: - Groups tests by image and binary - Identifies code locations appearing in 100% of tests for each binary - Reports violations as [sig-ci] flaky tests with detailed fix instructions - Skips binaries with <25 tests to avoid false positives - Supports an allowlist for temporary exceptions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ca5ffed to
0c1aeb6
Compare
|
/pipeline required |
|
Scheduling required tests: Scheduling tests matching the |
|
@stbenjam: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
Job Failure Risk Analysis for sha: 0c1aeb6
Risk analysis has seen new tests most likely introduced by this PR. New Test Risks for sha: 0c1aeb6
New tests seen in this PR at sha: 0c1aeb6
|
|
PR needs rebase. DetailsInstructions 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. |
When exutil.FixturePath() or exutil.NewCLI*() is called at package level (in a var declaration outside any function), it registers BeforeEach/AfterEach hooks at the root of the Ginkgo tree. This causes these hooks to run for EVERY SINGLE TEST in the suite, even when not needed, wasting CI resources and adding unnecessary test execution time.
This PR fixes the remaining cases of package-level FixturePath() calls by converting them to lazy functions.
Additionally, this PR adds runtime detection that creates flaky JUnit test cases when global nodes are detected. This allows CI to track future violations without blocking test runs. The detection:
🤖 Generated with Claude Code