Repository navigation
RT-1.1: Fix intermittent notification counter race and peer-as telemetry lag in base_bgp_session_parameters - #6172
Conversation
Summary of ChangesHello, 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 test failures in the base_bgp_session_parameters suite by improving synchronization between test execution and the DUT's telemetry state. By implementing asynchronous watches and explicit await barriers, the changes ensure that telemetry data is fully propagated and captured before verification, effectively eliminating race conditions during session teardown and configuration updates. Highlights
Using Gemini Code AssistThe 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
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 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
|
Pull Request Functional Test Report for #6172 / d4f01f8Virtual Devices
Hardware Devices
|
There was a problem hiding this comment.
Code Review
This pull request improves the reliability of BGP session parameter tests by replacing direct state checks with asynchronous watches. Specifically, it adds a watch to ensure the BGP neighbor session state is IDLE during configuration cleanup, uses an asynchronous watch for received NOTIFICATION messages in the disconnect test to avoid race conditions, and awaits the correct Peer AS state in parameter tests. The feedback recommends using the ygot-generated getter GetBgp() instead of direct field access to ensure nil-safety and prevent potential nil-pointer dereference panics.
|
Hi @AmrNJ @navaneethyv @jayakumarramisetty, could you please help review this PR or assign someone who can take a look? Thanks! |
|
Hi @navaneethyv @AmrNJ @jayakumarramisetty |
Summary
Fixes intermittent telemetry synchronization races and session teardown handling in
base_bgp_session_parameters_test(RT-1.1)Problem
TestEstablishAndDisconnect): The test sequentially awaited session disconnect and error code verification before executing a synchronousgnmi.Getfor the received NOTIFICATION counter. Because active session counters reset when BGP transitions toIDLE, fast session teardowns caused the test to intermittently read0(received NOTIFICATION count got 0, want > 0).TestParameters): Callingconfirm.State()immediately after modifyingpeer-asintermittently read stale state before the DUT's telemetry engine converged on the new AS.bgpClearConfig):bgpClearConfig()deleted the BGP config without awaiting session teardown toIDLE, leaking transitioning session state into subsequent subtests.Fix
gnmi.WatchonNOTIFICATION().State()before sending the CEASE notification, capturing the counter increment in real time as the packet arrives and eliminating the race against session teardown.gnmi.AwaitfornbrPath.PeerAs().State()to reachwantPeerASbefore executingconfirm.State().gnmi.WatchinbgpClearConfig()waiting forSessionState == IDLEbefore proceeding to the next subtest.Verification
RT-1.1 Pass 1.log
RT-1.1 Pass 2.log
RT-1.1 Pass 3.log
Pass log for other Nokia, Juniper and Cisco
RT-1.1 Cisco Pass log.log
RT-1.1 Nokia Pass log.log
RT-1.1 Juniper Pass log.log