Skip to content

bfdd: bfd tx timeout topotest cleanup - #21026

Merged
ton31337 merged 1 commit into
FRRouting:masterfrom
sougatahitcs:bfd_actual_tx_timeout_with_applied_jitter_topotest_cleanup
Apr 7, 2026
Merged

bfdd: bfd tx timeout topotest cleanup#21026
ton31337 merged 1 commit into
FRRouting:masterfrom
sougatahitcs:bfd_actual_tx_timeout_with_applied_jitter_topotest_cleanup

Conversation

@sougatahitcs

Copy link
Copy Markdown
Contributor

removing statistical check from the respective topotest as it is failing in upstream test system.
parent commit details: 3667cf1 Sougata Sat Dec 6 22:07 :16 2025 +0530 bfd: store actual tx timeout information in bfd

@frrbot frrbot Bot added the bfd label Mar 5, 2026
@greptile-apps

greptile-apps Bot commented Mar 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR cleans up the BFD jitter topotest by removing the statistical averaging check from test_bfd_jitter_formula_validation that was failing in the upstream CI system. The old approach sampled xmt_TO_actual 20 times and asserted the mean fell between 80–95% β€” inherently fragile because a single jittered TX interval is shown per show bfd peers poll, so rapid polling can return the same value repeatedly. The replacement approach takes a single snapshot and verifies it is within the RFC-mandated bounds, which is the correct way to validate a point-in-time jitter value.

Key changes:

  • Removes the 20-sample statistical loop and average-percentage assertion from test_bfd_jitter_formula_validation
  • Re-enables test_bfd_jitter_detect_mult_one (previously _DISABLED_) as a single-snapshot check verifying the 75–90% range for detect_mult == 1
  • Drops unused helper functions capture_bfd_packets and calculate_intervals (all packet-capture based tests were already disabled)
  • Removes all remaining _DISABLED_* test stubs and cleans up the now-unnecessary import time
  • Fixes the RFC 5880 section reference in the module docstring from Β§6.5.2 to Β§6.8.7 (the correct "Transmitting BFD Control Packets" section)

Confidence Score: 4/5

  • Safe to merge β€” the cleanup correctly removes a provably flaky statistical check and replaces disabled tests with simpler, correct single-snapshot assertions.
  • The logic of both surviving tests is sound: each reads a single xmt_TO_actual snapshot after the BFD session is confirmed up (ensuring the timer has fired at least once with the relevant detect_mult), and checks it against the RFC 5880-mandated bounds. The removed statistical assertion (80–95% average over 20 rapid polls) was unreliable because rapid show bfd peers calls can return the same cached value multiple times, skewing the average. No test coverage is lost for the core jitter-range requirement; coverage is actually improved for the detect_mult=1 case which was previously disabled. Minor note: neither new test adds a step() call around the final assertion, but that is cosmetic only.
  • No files require special attention.

Sequence Diagram

sequenceDiagram
    participant Test as pytest runner
    participant R1 as r1 (vtysh)
    participant R2 as r2 (vtysh)

    Note over Test,R2: test_bfd_session_up
    Test->>R1: show bfd peers json
    R1-->>Test: peer 192.168.1.2 status=up?
    Test->>R2: show bfd peers json
    R2-->>Test: peer 192.168.1.1 status=up?

    Note over Test,R2: test_bfd_jitter_formula_validation (detect_mult=3)
    Test->>R1: show bfd peers
    R1-->>Test: Transmission interval (actual with jitter): Xms
    Test->>R1: show bfd peers json
    R1-->>Test: transmit-interval = nominal
    Note over Test: Assert 75% ≀ X ≀ 100% of nominal

    Note over Test,R2: test_bfd_jitter_detect_mult_one
    Test->>R1: configure detect-multiplier 1
    loop wait for BFD up (count=60, wait=1s)
        Test->>R1: show bfd peers json
        R1-->>Test: status=up?
    end
    Test->>R1: show bfd peers
    R1-->>Test: Transmission interval (actual with jitter): Yms
    Test->>R1: show bfd peers json
    R1-->>Test: transmit-interval = nominal
    Note over Test: Assert 75% ≀ Y ≀ 90% of nominal
Loading

Last reviewed commit: 7c93b97

removing statistical check from the respective topotest as it is failing in upstream test system.
parent commit details: 3667cf1   Sougata Sat Dec 6 22:07 :16 2025 +0530   bfd: store actual tx timeout information in bfd

Signed-off-by: Sougata Barik <sougatahitcs@gmail.com>
Made-with: Cursor
@sougatahitcs
sougatahitcs force-pushed the bfd_actual_tx_timeout_with_applied_jitter_topotest_cleanup branch from 7c93b97 to 95ddd85 Compare March 6, 2026 17:36
@ton31337
ton31337 merged commit 75e7c3b into FRRouting:master Apr 7, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants