Update telemetry_basic_check_test.go - #5834
Conversation
AmrNJ
commented
Aug 5, 2026
- Use gnmi.Watch instead of gnmi.Lookup to avoid errors seen by duplicate entries.
- Remove DSCP56 as it is reserved for Network control traffic and control plane is dropping the traffic due to rate limit.
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 improves the robustness of the telemetry basic check test by updating the data retrieval mechanism and refining the test traffic configuration. These changes ensure more stable test execution by addressing potential telemetry race conditions and avoiding conflicts with reserved network control traffic policies. 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 #5834 / 774fbe8Virtual Devices
Hardware Devices
|
There was a problem hiding this comment.
Code Review
This pull request updates the telemetry basic check test to use gnmi.Watch instead of gnmi.Lookup for retrieving an interface's MAC address, and removes a DSCP PHB configuration from an IPv4 flow. The review feedback recommends enhancing the robustness of the gnmi.Watch condition by verifying that the retrieved MAC address is both present and non-empty to avoid transient uninitialized states.
| val, ok := gnmi.Watch(t, dut.GNMIOpts().WithYGNMIOpts(opts...), gnmi.OC().Interface(intfName).Ethernet().MacAddress().State(), time.Minute, func(v *ygnmi.Value[string]) bool { | ||
| return v.IsPresent() | ||
| }).Await(t) |
There was a problem hiding this comment.
To ensure robustness and follow defensive programming practices, the watch condition should verify that the retrieved MAC address is not only present but also non-empty. Some devices might transiently report an empty string or uninitialized state when the interface is first configured, which would satisfy v.IsPresent() but result in an invalid MAC address being returned.
val, ok := gnmi.Watch(t, dut.GNMIOpts().WithYGNMIOpts(opts...), gnmi.OC().Interface(intfName).Ethernet().MacAddress().State(), time.Minute, func(v *ygnmi.Value[string]) bool {
val, present := v.Val()
return present && val != ""
}).Await(t)