Repository navigation
Conversation
Pin the public OpenConfig 5.11 global-filter regeneration and use typed policy configuration, deletion and CONFIG/STATE reads. Preserve batching, Cisco JSON_IETF encoding and fresh reconnect transports. Include the wire-contract check and Jenkins reproduction instructions. AFT-6.1 passed all seven groups and four prefix variants from the prepared public checkout; all four AFT binaries compiled.
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 completes the migration of AFT filtered-streaming tests to use typed Ondatra OpenConfig bindings. It carries forward critical filtering fixes required for Cisco IOS XR, ensuring consistent test behavior across vendors. The changes include updated test implementations, shared collector improvements, and robust diagnostic capabilities to facilitate future debugging and validation. 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
|
There was a problem hiding this comment.
Code Review
This pull request transitions the AFT prefix filtering tests (AFT-6.1 through AFT-6.4) to use typed Ondatra and ygnmi bindings instead of raw gNMI paths. It introduces platform exceptions and robust diagnostic helpers to accommodate Cisco IOS XR limitations, such as replacing complete prefix-sets and using BGP-origin AFT summaries for VRF convergence. The review feedback highlights critical improvements: replacing t.Logf calls in asynchronous background goroutines within aft_cache.go to prevent flaky test panics, and replacing several usages of context.Background() with t.Context() in gNMI operations to ensure proper timeout and cancellation handling.
| if err != nil { | ||
| counters.receiveFailure.Store(&aftSubscriptionResponse{err: err}) | ||
| if ctx.Err() == nil { | ||
| // Record the client queue at the actual receive failure, | ||
| // before its error waits behind any buffered notifications. | ||
| // This is not the DUT's MDT destination queue. | ||
| t.Logf("DUT %s NI=%s AFT stream receive failed UTC=%s: %v; CLIENT buffered notifications=%d/%d received=%d processed=%d (not the DUT queue)", | ||
| dut.Name(), networkInstance, time.Now().UTC().Format(time.RFC3339Nano), err, | ||
| len(buffer), cap(buffer), counters.received.Load(), counters.processed.Load()) | ||
| select { | ||
| case buffer <- &aftSubscriptionResponse{err: err}: | ||
| case <-ctx.Done(): | ||
| } | ||
| } | ||
| return | ||
| } | ||
| counters.received.Add(1) | ||
| counters.lastReceived.Store(time.Now().UnixNano()) | ||
| if n.GetSyncResponse() { | ||
| counters.syncReceived.Add(1) | ||
| t.Logf("DUT %s gNMI AFT SyncResponse arrived; buffered notifications=%d/%d", | ||
| dut.Name(), len(buffer), cap(buffer)) | ||
| } |
There was a problem hiding this comment.
Calling t.Logf inside an asynchronous background goroutine is a known anti-pattern in Go tests. If the test finishes or is cancelled while the background goroutine is still receiving messages or handling errors, calling t.Logf will cause a panic (testing: t.Logf called after Test... has finished), leading to flaky test failures. Since these events are already logged or tracked via ss.Progress() and ListenUntil, we should safely remove these asynchronous logging calls.
if err != nil {
counters.receiveFailure.Store(&aftSubscriptionResponse{err: err})
if ctx.Err() == nil {
select {
case buffer <- &aftSubscriptionResponse{err: err}:
case <-ctx.Done():
}
}
return
}
counters.received.Add(1)
counters.lastReceived.Store(time.Now().UnixNano())
if n.GetSyncResponse() {
counters.syncReceived.Add(1)
}| t.Logf("Sending typed AFT global-filter Set batch: %s", batch) | ||
| started := time.Now() | ||
| t.Logf("AFT global-filter Set start: UTC=%s NI=%s client=%p createdUTC=%s", started.UTC().Format(time.RFC3339Nano), cfg.VRFName, client, createdAt.UTC().Format(time.RFC3339Nano)) | ||
| response, err := batch.Set(context.Background(), typedClient, ygnmi.WithEncoding(ConfigEncoding(dut))) |
There was a problem hiding this comment.
Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.
| response, err := batch.Set(context.Background(), typedClient, ygnmi.WithEncoding(ConfigEncoding(dut))) | |
| response, err := batch.Set(t.Context(), typedClient, ygnmi.WithEncoding(ConfigEncoding(dut))) |
| batch := &ygnmi.SetBatch{} | ||
| ygnmi.BatchDelete(batch, filter.Ipv4Policy().Config()) | ||
| ygnmi.BatchDelete(batch, filter.Ipv6Policy().Config()) | ||
| _, err = batch.Set(context.Background(), client) |
There was a problem hiding this comment.
Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.
| _, err = batch.Set(context.Background(), client) | |
| _, err = batch.Set(t.Context(), client) |
| req := &gpb.SetRequest{Update: updates} | ||
| _, setErr := client.Set(context.Background(), req) | ||
| t.Logf("Sending typed AFT global-filter negative-check Set batch: %s", batch) | ||
| _, setErr := batch.Set(context.Background(), client, ygnmi.WithEncoding(aftpf.ConfigEncoding(dut))) |
There was a problem hiding this comment.
Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.
| _, setErr := batch.Set(context.Background(), client, ygnmi.WithEncoding(aftpf.ConfigEncoding(dut))) | |
| _, setErr := batch.Set(t.Context(), client, ygnmi.WithEncoding(aftpf.ConfigEncoding(dut))) |
| } | ||
| req := &gpb.SetRequest{Delete: []*gpb.Path{policyDefinitionPath(policyName)}} | ||
| t.Logf("Sending policy-definition delete gNMI SetRequest: %v", req) | ||
| _, setErr := client.Set(context.Background(), req) |
There was a problem hiding this comment.
Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.
| _, setErr := client.Set(context.Background(), req) | |
| _, setErr := client.Set(t.Context(), req) |
| ygnmi.BatchDelete(batch, filter.Ipv4Policy().Config()) | ||
| ygnmi.BatchDelete(batch, filter.Ipv6Policy().Config()) | ||
| ygnmi.BatchDelete(batch, gnmi.OC().RoutingPolicy().PolicyDefinition(policyName).Config()) | ||
| if _, err := batch.Set(context.Background(), client); err != nil { |
There was a problem hiding this comment.
Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.
| if _, err := batch.Set(context.Background(), client); err != nil { | |
| if _, err := batch.Set(t.Context(), client); err != nil { |
| if _, err := client.Set(context.Background(), req); err != nil { | ||
| started := time.Now() | ||
| t.Logf("Sending prefix-set reference gNMI SetRequest UTC=%s: %v", started.UTC().Format(time.RFC3339Nano), req) | ||
| response, setErr := client.Set(context.Background(), req) |
There was a problem hiding this comment.
Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.
| response, setErr := client.Set(context.Background(), req) | |
| response, setErr := client.Set(t.Context(), req) |
Title: AFT-6.1–6.4: carry forward Cisco filtering fixes and migrate to typed Ondatra bindings
Description:
This PR brings the AFT filtered-streaming changes from internal PR #2822 into public FeatureProfiles and replaces its handwritten global-filter configuration paths with generated Ondatra OpenConfig bindings.
It includes the AFT test implementations, shared collector changes, public dependency pin, binding verification test and reproduction instructions.
Background and changes inherited from #2822
PR #2822 adapted AFT-6.1 through AFT-6.4 to the Cisco IOS XR behavior observed during SIM testing. These include changes to test expectations and coverage, alongside configuration, collection and diagnostic fixes.
Only AFT-6.1 was rerun from the prepared public checkout for this publication. No Jenkins job or hardware test was launched.
The validated local SIM profile used IOS XR 26.4.1.34I, OTG 1.48.0-5, an existing ten-second pre-traffic delay and process-wide doubled context deadlines. Those timing adjustments belong to the external SIM harness and are not included in this PR.
Running through Jenkins
Select Public as the test repository and this upstream PR’s number under Test PR. Clear conflicting branch/commit selections and old internal or fork repository overrides.
Use Go 1.26.3 and provide the normal testbed, image and SIM profile. See
docs/aft-typed-global-filter-bindings.mdfor setup details and validation limits.The validation above does not establish that all four tests pass under a runner with different timing settings; AFT-6.4 runtime validation is still outstanding.
**Title:** AFT-6.1–6.4: carry forward Cisco filtering fixes and migrate to typed Ondatra bindingsDescription:
This PR brings the AFT filtered-streaming changes from internal PR #2822 into public FeatureProfiles and replaces its handwritten global-filter configuration paths with generated Ondatra OpenConfig bindings.
It includes the AFT test implementations, shared collector changes, public dependency pin, binding verification test and reproduction instructions.
Background and changes inherited from #2822
PR #2822 adapted AFT-6.1 through AFT-6.4 to the Cisco IOS XR behavior observed during SIM testing. These include changes to test expectations and coverage, alongside configuration, collection and diagnostic fixes.
These changes are inherited from #2822 rather than introduced by the typed-binding migration.
Typed-binding migration added by this PR
Global-filter operations now use generated paths rooted at:
The migration covers policy configuration, deletion, negative checks and CONFIG/STATE readback.
Direct protocol access therefore remains for notification assertions. It is no longer used as the missing-binding workaround for global-filter configuration and readback.
Ondatra dependency
The PR pins the public supporting module:
[Supporting Ondatra commit](b4firex/ondatra@ff48602)
This starts from upstream Ondatra v0.15.1/OpenConfig 5.11.0 and adds the missing
openconfig-aft-global-filter.yanggenerator input and regenerated bindings. Updating the model version alone did not provide the global-filter API required by these tests.Related tracking: [openconfig/ondatra#159](openconfig/ondatra#159).
A fresh checkout resolves the dependency publicly; no private module, sibling checkout or manual binding generation is required.
The dependency changes also update Go to 1.26.3 and additional direct/transitive dependencies, including gosnappi, KNE and gRPC. This is the validated dependency set; it has not been minimized to establish whether every version bump is necessary.
Validation
Only AFT-6.1 was rerun from the prepared public checkout for this publication. No Jenkins job or hardware test was launched.
The validated local SIM profile used IOS XR 26.4.1.34I, OTG 1.48.0-5, an existing ten-second pre-traffic delay and process-wide doubled context deadlines. Those timing adjustments belong to the external SIM harness and are not included in this PR.
Running through Jenkins
Select Public as the test repository and this upstream PR’s number under Test PR. Clear conflicting branch/commit selections and old internal or fork repository overrides.
Use Go 1.26.3 and provide the normal testbed, image and SIM profile. See
docs/aft-typed-global-filter-bindings.mdfor setup details and validation limits.The validation above does not establish that all four tests pass under a runner with different timing settings; AFT-6.4 runtime validation is still outstanding.