Skip to content

fix metallb e2e #5183

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

Merged
merged 2 commits into from
Apr 25, 2025
Merged

fix metallb e2e #5183

merged 2 commits into from
Apr 25, 2025

Conversation

changluyi
Copy link
Collaborator

Pull Request

What type of this PR

Examples of user facing changes:

  • Features
  • Bug fixes
  • Docs
  • Tests

Which issue(s) this PR fixes

Fixes #(issue-number)

Signed-off-by: clyi <[email protected]>
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 24, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @changluyi, 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!

Summary of Changes

This pull request addresses an issue in the MetalLB end-to-end tests. Specifically, it adds a command to explicitly check the ARP table using arping before proceeding with the VIP node verification. This is done to ensure the ARP table is stable, as it may not be immediately after the system starts, which could lead to test failures.

Highlights

  • Bug Fix: Addresses an intermittent failure in MetalLB E2E tests due to unstable ARP tables.
  • ARP Check: Introduces an arping command to stabilize the ARP table before checking VIP node reachability.

Changelog

  • test/e2e/metallb/e2e_test.go
    • Added arping command to check ARP table stability before verifying VIP node reachability.
    • The arping command is executed with a count of 5 to ensure stability.
    • The output of the arping command is logged for debugging purposes.
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 is currently in preview and 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 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.


The ARP table's fickle state,
Can cause our tests to meet their fate.
So arping we send,
A fix to extend,
And make our E2E tests great.

Footnotes

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a change to the e2e test for MetalLB, specifically adding an arping command before the curl command to ensure ARP is stable. This is a good addition to improve the reliability of the test. However, there are a few things that can be improved.

Summary of Findings

  • ARP stability: The added arping command aims to improve ARP stability before checking VIP reachability. While the intention is good, the implementation could be more robust by checking the result of the arping command.
  • Error handling: The code logs the output of the arping command but doesn't check for errors. It's important to handle errors to ensure the test behaves as expected.

Merge Readiness

The change seems reasonable and addresses a potential flakiness in the e2e test. However, the error handling for the arping command should be improved before merging. I am unable to approve this pull request, and recommend that others review and approve this code before merging.

Comment on lines 380 to 383
// the arp may not be stable when just started
cmd = strings.Fields(fmt.Sprintf("arping -c 5 %s", targetIP))
output, _, err = docker.Exec(containerID, nil, cmd...)
framework.Logf("arping result is %s ", output)

Choose a reason for hiding this comment

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

high

The arping command is executed, and its output is logged, but the code doesn't check if the arping command was successful. It's important to check the error returned by docker.Exec to ensure that arping completed successfully before proceeding with the curl command. If arping fails, the test should fail or retry, rather than continuing with potentially unstable ARP entries. Consider adding a check for err != nil after the docker.Exec call, and failing the test if the error is present.

Suggested change
// the arp may not be stable when just started
cmd = strings.Fields(fmt.Sprintf("arping -c 5 %s", targetIP))
output, _, err = docker.Exec(containerID, nil, cmd...)
framework.Logf("arping result is %s ", output)
// the arp may not be stable when just started
cmd = strings.Fields(fmt.Sprintf("arping -c 5 %s", targetIP))
output, _, err = docker.Exec(containerID, nil, cmd...)
if err != nil {
framework.Failf("arping failed: %v, output: %s", err, output)
}
framework.Logf("arping result is %s ", output)

@dosubot dosubot bot added the test automation tests label Apr 24, 2025
Signed-off-by: clyi <[email protected]>
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 24, 2025
@changluyi changluyi merged commit 43c6ee8 into master Apr 25, 2025
75 checks passed
@changluyi changluyi deleted the fix_metallb_e2e branch April 25, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files. test automation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants