-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix dra flaky test: use exec env instead logs
#4531
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
Fix dra flaky test: use exec env instead logs
#4531
Conversation
Signed-off-by: JesseStutler <[email protected]>
|
@JesseStutler: The label(s) In response to this:
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/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @JesseStutler, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've addressed a known flakiness issue in the Dynamic Resource Allocation (DRA) end-to-end tests. The previous method of verifying environment variables by inspecting pod logs was prone to race conditions. This change updates the test logic to directly execute the env command within the test pods once they are running, providing a more robust and reliable way to assert the presence of expected environment variables. This should significantly improve the stability of the DRA E2E test suite.
Highlights
- Reliable Environment Variable Checking: The core change involves switching from checking environment variables by parsing pod logs (which could be subject to race conditions) to directly executing the
envcommand within the running container usinge2epod.ExecWithOptionsContext. This ensures that the environment variables are retrieved reliably after the pod is confirmed to be running. - Refactored Test Helper Functions: The
testPodandtestContainerEnvfunctions were refactored to accept a*framework.Frameworkinstance, providing a more consistent and direct way to access Kubernetes client functionalities and other testing utilities. - Simplified Test Pod Creation: The
pod()function now creates a simpler pod that effectively pauses, as theenvcommand is no longer part of the pod's initial command. This streamlines the test pod's behavior, focusing its purpose on being a target forexeccommands.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
|
/kind flake |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Monokaix The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cc @lowang-bh @hwdef @archlitchi Could you put an LGTM for this PR? |
hwdef
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
What type of PR is this?
/area flaky
What this PR does / why we need it:
DRA sometimes failed recently: https://github.com/volcano-sh/volcano/actions/runs/16809889541/job/47612203028?pr=4517, this PR can fix this: kubernetes/kubernetes#130141, it's because that previously, "env" ran as the command inside the container and its log output
was checked. That suffered from a race because even though the pod might be
reported as running, there's no guarantee that the command has really produced
output and that this output has been captured. Therefore, we might use
exec envinstead, if the pod is already running,exec envcan get the expected resultWhich issue(s) this PR fixes:
NONE
Special notes for your reviewer:
Does this PR introduce a user-facing change?