Skip to content

Adding 50 extra seconds to account for the following variables:#5252

Open
fmolinar wants to merge 1 commit intoopenconfig:mainfrom
b4firex:fmolinar/rt-1.1
Open

Adding 50 extra seconds to account for the following variables:#5252
fmolinar wants to merge 1 commit intoopenconfig:mainfrom
b4firex:fmolinar/rt-1.1

Conversation

@fmolinar
Copy link
Copy Markdown
Contributor

This provides a 60-second margin over the hold timer, easily accommodating the propagation pipeline. Formula: timeout ≥ hold_timer + keepalive_interval + 30s_margin = 90 + 30 + 30 = 150s.

timeout ≥ hold_timer + keepalive_interval + 30s_margin = 90 + 30 + 30 = 150s.
@fmolinar fmolinar requested a review from a team as a code owner March 23, 2026 23:00
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

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

This pull request enhances the reliability of BGP session parameter tests by extending a critical timeout duration. This adjustment ensures that the test environment can adequately account for network propagation delays and other variables, preventing premature test failures and improving the accuracy of BGP session state verification.

Highlights

  • BGP Test Timeout Adjustment: Increased the wait time in a BGP session parameter test from dutHoldTime + 10 seconds to dutHoldTime + 60 seconds to provide a more robust margin for network propagation and test stability.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

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.

@OpenConfigBot
Copy link
Copy Markdown

Pull Request Functional Test Report for #5252 / cf7aa8b

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
RT-1.1: Base BGP Session Parameters
Cisco 8000E status
RT-1.1: Base BGP Session Parameters
Cisco XRd status
RT-1.1: Base BGP Session Parameters
Juniper ncPTX status
RT-1.1: Base BGP Session Parameters
Nokia SR Linux status
RT-1.1: Base BGP Session Parameters
Openconfig Lemming status
RT-1.1: Base BGP Session Parameters

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
RT-1.1: Base BGP Session Parameters
Cisco 8808 status
RT-1.1: Base BGP Session Parameters
Juniper PTX10008 status
RT-1.1: Base BGP Session Parameters
Nokia 7250 IXR-10e status
RT-1.1: Base BGP Session Parameters

Help

Copy link
Copy Markdown
Contributor

@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

This pull request increases the timeout for a BGP session state check in TestPassword to prevent test flakiness. The change increases the margin from 10 to 60 seconds over the BGP hold time. While the new timeout value is correct, the implementation uses a magic number. My feedback suggests replacing this with an expression using existing constants to improve code clarity and maintainability, aligning with the logic provided in the pull request description.

}
t.Log("Wait till hold time expires: BGP should not be in ESTABLISHED state when passwords do not match.")
_, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), (dutHoldTime+10)*time.Second, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool {
_, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), (dutHoldTime+60)*time.Second, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool {
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.

medium

While the increased timeout of 150 seconds (dutHoldTime of 90s + 60s) is correct according to the pull request description, using the magic number 60 makes the code harder to understand and maintain. The description explains this margin as keepalive_interval + 30s_margin. Since dutKeepaliveTime is 30s, this margin is equivalent to 2 * dutKeepaliveTime. Using this expression makes the intent clearer and ties the timeout to the relevant BGP parameters.

Suggested change
_, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), (dutHoldTime+60)*time.Second, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool {
_, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), (dutHoldTime+2*dutKeepaliveTime)*time.Second, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants