Skip to content

P4RT-5.3 : Add settle delays around StartProtocols so BGP reconverges before traffic - #6171

Open
ArpitJoshi18 wants to merge 1 commit into
openconfig:mainfrom
ArpitJoshi18:p4rt53_delay
Open

ArpitJoshi18 wants to merge 1 commit into
openconfig:mainfrom
ArpitJoshi18:p4rt53_delay

Conversation

@ArpitJoshi18

Copy link
Copy Markdown
Member

Mirror the TE-17.1 vrf_policy_driven_te as baseline setup to add settle pattern in the P4RT-5.3 test:

30s after PushConfig and 60s after StartProtocols.
This lets BGP reconverge
after the StartProtocols flap before traffic, fixing intermittent PacketIn
egress port 0 failures.

@ArpitJoshi18
ArpitJoshi18 requested a review from a team as a code owner October 15, 2026 21:47
@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 addresses intermittent PacketIn egress port failures in the P4RT-5.3 test by introducing explicit settle delays. By allowing sufficient time for BGP to reconverge following configuration and protocol initialization, the test stability is improved.

Highlights

  • Added settle delays: Introduced 30-second and 60-second sleep intervals to allow BGP reconvergence after configuration push and protocol startup.
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 the 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 counterproductive. 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. ↩

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

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.

Code Review

This pull request introduces static time.Sleep delays in packetin_test.go before and after starting OTG protocols to allow for BGP convergence. The review feedback correctly identifies this as a violation of the style guide, which prohibits static sleeps. The reviewer recommends replacing these with dynamic waiting mechanisms, such as gnmi.Watch or otgutils.WaitForARP, to prevent unnecessary delays in the test execution pipeline.

Comment on lines +117 to +120
time.Sleep(30 * time.Second)
ate.OTG().StartProtocols(t)
// Wait for the StartProtocols BGP flap to reconverge before sending traffic.
time.Sleep(60 * time.Second)

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.

high

Avoid using static time.Sleep calls after pushing configurations or starting protocols in OTG tests, as they act as a fixed tax on the test execution pipeline. Instead, rely on dynamic waiting mechanisms. For example, use otgutils.WaitForARP to wait for ARP resolution, or use dynamic checks (like gnmi.Watch with .Await) to wait for BGP neighbor session states to reach ESTABLISHED before proceeding.

References
  1. Eliminating Polling Loops and Static Sleeps: Relying on static time.Sleep calls is banned. The use of gnmi.Watch is mandatory to detect desired states in real-time. Wait times should not be hardcoded, as static sleeps become a fixed tax on the pipeline. (link)
  2. Avoid using static sleeps (such as time.Sleep) after pushing configurations or starting protocols in OTG tests. Instead, rely on dynamic waiting mechanisms like WaitForARP after starting protocols to ensure that the configuration push and protocol startup were successful.

@OpenConfigBot

Copy link
Copy Markdown

Pull Request Functional Test Report for #6171 / 094e003

Virtual Devices

Device Test Status Test Documentation Job Raw Log
Arista cEOS status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Cisco 8000E status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Cisco XRd status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Juniper ncPTX status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Nokia SR Linux status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Openconfig Lemming status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection

Hardware Devices

Device Test Status Test Documentation Raw Log
Arista status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Cisco status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Juniper status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection
Nokia status
P4RT-5.3: pending authorization
P4RT-5.3: Traceroute: PacketIn With VRF Selection

Help

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants