Repository navigation
[DP-1.11] qos: wait for flow transmission stop and in-flight packet drain in bursty_traffic_test - #6259
[DP-1.11] qos: wait for flow transmission stop and in-flight packet drain in bursty_traffic_test#6259arnavanand-lgtm wants to merge 4 commits into
Conversation
…in in bursty_traffic_test
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 a race condition in the bursty_traffic_test where assertions were failing due to transient in-flight packets being counted before they had fully cleared the network buffers. By introducing explicit state monitoring for transmission status and packet counter stabilization, the test now ensures accurate measurement of traffic drops. Additionally, the removal of an arbitrary sleep timer improves the efficiency of the test suite. 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 #6259 / 6f847c3Virtual Devices
Hardware Devices
|
There was a problem hiding this comment.
Code Review
This pull request optimizes the bursty traffic test by removing a static 30-second sleep before starting traffic and introducing dynamic waiting logic in stopTrafficOnFlows using gnmi.Watch to confirm transmission has stopped and in-flight packets have drained. The review feedback identifies a bug in the packet-draining watch logic where a flow receiving zero packets (e.g., due to a traffic generation failure) will cause the watch to always time out after 15 seconds. A code suggestion is provided to resolve this by tracking the previous sample state with a boolean flag instead of a rx > 0 check.
|
Hi @AmrNJ @navaneethyv @jayakumarramisetty, could you please help review this PR or assign someone who can take a look? Thanks! |
navaneethyv
left a comment
There was a problem hiding this comment.
Looks good. please apply the Gemini comments before closure.
|
Hi @navaneethyv @jayakumarramisetty @AmrNJ |
Summary
In #5941,
stopTrafficOnFlowswas introduced to asynchronously stop traffic flows between subtests usinggosnappi.StateTrafficFlowTransmitState.STOP. However,SetControlStatereturns immediately without waiting for transmission to halt or in-flight packets to clear the link and switch buffers.When sampling flow counters immediately after
stopTrafficOnFlows, transient in-flight packets (~90–200 packets / 48–100 KB) causedateOutPkts > ateInPktsat the instantgnmi.Getwas called. Because the physical DUT switch forwarded all traffic without drops (dutDropOctetCounterDiff = 0), the assertion:if dutDropOctetCounterDiff < ateDropOctetCounterDiff { t.Errorf(...) }failed with
got 0, want >= <ateDrop>across all 7 QoS queue subtests, despite 100% throughput verified moments later once counters settled.Changes Made
stopTrafficOnFlows:gnmi.OTG().Flow(id).Transmit().State() == falseto confirm OTG transmission has stopped.gnmi.OTG().Flow(id).Counters().InPkts().State()counter stabilization across consecutive samples, using ahasLastRxtracker (per Gemini review feedback) so zero-packet flows also exit immediately instead of hitting the 15s timeout before assertions execute.time.Sleep(30 * time.Second)beforestartTrafficOnFlows, reducing test execution time by ~3.5 minutes without impacting traffic stability.Verification
Validated after the
hasLastRxupdate across physical hardware testbeds for all 4 vendors (5/5 runs PASS, all 7 QoS queue subtestsNC1,AF4,AF3,AF2,AF1,BE0,BE1passing with 100% throughput; also resolves the pre-existingmainNokia IXR10E drain failure onBursty_NC1_traffic):5m 54s, 7/7 subtests)DP-1.11 7280_j2 pass.log
5m 56s, 7/7 subtests)DP-1.11 7280_j2cplus.log
5m 50s, 7/7 subtests)DP-1.11 7250_IXR10e.log
8m 37s, 7/7 subtests)DP-1.11 PTX10001.log
10m 50s, 7/7 traffic + 7/7 forwarding-group subtests)DP-1.11 cisco8808.log