Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RT-7.1] Fix telemetry data validation using gnmi ON_CHANGE stream mode#5674

Open
sriram-arista wants to merge 1 commit into
openconfig:mainfrom
sriram-arista:RT-7.1-fix
Open

[RT-7.1] Fix telemetry data validation using gnmi ON_CHANGE stream mode#5674
sriram-arista wants to merge 1 commit into
openconfig:mainfrom
sriram-arista:RT-7.1-fix

Conversation

@sriram-arista

Copy link
Copy Markdown

Issue:

Currently the test validates that some prefix telemetry data on the dut based on the leaf node and the inbound/outbound policy applied. The test fails sometimes when the gnmi.Watch call timesout/returning with a value that doesn't satisfy the condition in the predicate passed.

Root cause:

The default stream mode being TARGET_DEFINED, the gnmi.Watch lets the target to decide how the stream updates have to be sent. Arista has a set of pre-configured list of nodes that are considered to be chatty (rapidly changing). To avoid sending frequent updates in the stream, the device will SAMPLE the updates and send them in the stream. Arista devices have a default SAMPLE rate of 30 secs.

Fix:

Usage of the ON_CHANGE stream mode in gnmi.Watch so that all the updates within the timeout window are received in the test, to avoid timing failures.

Issue:

Currently the test validates that some prefix telemetry data on the dut
based on the leaf node and the inbound/outbound policy applied.
The test fails sometimes when the gnmi.Watch call timesout/returning with a value
that doesn't satisfy the condition in the predicate passed.

Root cause:

The default stream mode being TARGET_DEFINED, the gnmi.Watch lets the
target to decide how the stream updates have to be sent. Arista has a set of
pre-configured list of nodes that are considered to be chatty (rapidly changing).
To avoid sending frequent updates in the stream, the device will SAMPLE the updates
and send them in the stream. Arista devices have a default SAMPLE rate of 30 secs.

Fix:

Usage of the ON_CHANGE stream mode in gnmi.Watch so that all the updates
within the timeout window are received in the test, to avoid timing failures.
@sriram-arista sriram-arista requested review from a team as code owners July 6, 2026 18:51
@OpenConfigBot

Copy link
Copy Markdown

Pull Request Functional Test Report for #5674 / e48bfb1

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
RT-7.1: BGP default policies
Cisco 8000E status
RT-7.1: BGP default policies
Cisco XRd status
RT-7.1: BGP default policies
Juniper ncPTX status
RT-7.1: BGP default policies
Nokia SR Linux status
RT-7.1: BGP default policies
Openconfig Lemming status
RT-7.1: BGP default policies

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
RT-7.1: BGP default policies
Cisco 8808 status
RT-7.1: BGP default policies
Juniper PTX10008 status
RT-7.1: BGP default policies
Nokia 7250 IXR-10e status
RT-7.1: BGP default policies

Help

@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 telemetry validation failures in BGP policy tests. By switching from the default TARGET_DEFINED stream mode to ON_CHANGE, the tests can now reliably capture rapid updates that were previously being sampled and missed by the default 30-second sampling interval on certain devices. The changes include adding a new platform deviation to control this behavior and updating the relevant test suite to apply these options.

Highlights

  • Telemetry Validation Improvement: Updated telemetry data validation to use ON_CHANGE stream mode in gnmi.Watch to ensure all updates are received within the timeout window.
  • New Deviation Added: Introduced a new deviation 'stream_subscription_mode_on_change_required' to handle devices that require specific subscription modes for chatty nodes.
  • Test Stability: Refactored test code to utilize the new subscription mode configuration, preventing intermittent failures caused by default SAMPLE rates on Arista devices.
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 a new deviation, StreamSubscriptionModeOnChangeRequired, which allows tests to request ON_CHANGE subscription mode for frequently updated OpenConfig leaf nodes to prevent timing failures on certain devices. This deviation is integrated into the BGP default policies test. The feedback requests adding a tracking issue URL to the new deviation accessor function's comment in internal/deviations/deviations.go, as required by the repository style guide.

Comment on lines +2297 to +2302
// StreamSubscriptionModeOnChangeRequired returns true if the device requires
// ON_CHANGE subscription mode for frequently updated OC leaf nodes instead of
// TARGET_DEFINED. With TARGET_DEFINED, some devices defer SAMPLE updates for
// significant time, causing timing failures when a test checks a such a rapidly
// changing value with a timeout lesser than the SAMPLE rate.
func StreamSubscriptionModeOnChangeRequired(dut *ondatra.DUTDevice) 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

According to the repository style guide, every deviation accessor function must include a comment containing a URL link to an issue tracker (e.g., https://issuetracker.google.com/xxxxx or a GitHub issue) to document and track the behavior or eventual removal of the deviation. Please add a tracking issue URL to the comment.

// StreamSubscriptionModeOnChangeRequired returns true if the device requires
// ON_CHANGE subscription mode for frequently updated OC leaf nodes instead of
// TARGET_DEFINED. With TARGET_DEFINED, some devices defer SAMPLE updates for
// significant time, causing timing failures when a test checks a such a rapidly
// changing value with a timeout lesser than the SAMPLE rate.
//
// See: https://github.com/openconfig/featureprofiles/issues/xxxxx
func StreamSubscriptionModeOnChangeRequired(dut *ondatra.DUTDevice) bool {
References
  1. Every deviation accessor function must include a comment containing a URL link to an issue tracker (e.g., https://issuetracker.google.com/xxxxx) to document and track the behavior. (link)
  2. Every deviation accessor function, including those for permanent deviations, must include a comment with a URL link to an issue tracker (e.g., a tracking FR) to document and track the behavior.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants