From 97004e84f83eb1b61a8157fd59935e0f7888cf4c Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Sat, 14 Feb 2026 23:48:46 -0600 Subject: [PATCH] [nexus] fix flakiness in test 5.5.4.1 (#12455) This commit addresses the occasional failure of Nexus test 5.5.4.1 by increasing the merge wait time and improving the robustness of the packet verification script. Summary of changes: - In test_5_5_4_1.cpp, increased kMergeWaitTime from 200s to 300s. This provides sufficient time for all nodes to synchronize their Mesh-Local Prefix and update their routing tables after the network partitions merge. - In verify_5_5_4_1.py, updated Step 6 verification to filter ICMPv6 Echo Request and Reply packets by their specific identifier (0xabcd). This ensures that the verifier correctly identifies the packets from the intended test step and avoids matching stale or transient packets from earlier parts of the test. --- tests/nexus/test_5_5_4_1.cpp | 2 +- tests/nexus/verify_5_5_4_1.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/nexus/test_5_5_4_1.cpp b/tests/nexus/test_5_5_4_1.cpp index 435908633..cb041a425 100644 --- a/tests/nexus/test_5_5_4_1.cpp +++ b/tests/nexus/test_5_5_4_1.cpp @@ -57,7 +57,7 @@ static constexpr uint32_t kResetTime = 300 * 1000; /** * Time to wait for network merge. */ -static constexpr uint32_t kMergeWaitTime = 200 * 1000; +static constexpr uint32_t kMergeWaitTime = 300 * 1000; /** * The identifier used for Echo Request. diff --git a/tests/nexus/verify_5_5_4_1.py b/tests/nexus/verify_5_5_4_1.py index c0a79535c..13afc67e3 100644 --- a/tests/nexus/verify_5_5_4_1.py +++ b/tests/nexus/verify_5_5_4_1.py @@ -37,6 +37,10 @@ sys.path.append(CUR_DIR) import verify_utils from pktverify import consts +ECHO_IDENTIFIER = 0xabcd +STEP_3_START_IDENTIFIER = 0x5303 +STEP_3_END_IDENTIFIER = 0x5304 + def verify(pv): # 5.5.4 Split and Merge with Routers @@ -90,15 +94,16 @@ def verify(pv): # - Description: Reset the DUT for 300 seconds (longer than NETWORK_ID_TIMEOUT default value of 120 seconds). # - Pass Criteria: The DUT MUST stop sending MLE advertisements,. print("Step 3: Leader (DUT)") + # Find the markers for the reset period. markers = pv.pkts.copy() markers.filter_ping_request().\ - filter(lambda p: p.icmpv6.echo.identifier == 0x5303).\ + filter(lambda p: p.icmpv6.echo.identifier == STEP_3_START_IDENTIFIER).\ must_next() start_index = markers.index markers.filter_ping_request().\ - filter(lambda p: p.icmpv6.echo.identifier == 0x5304).\ + filter(lambda p: p.icmpv6.echo.identifier == STEP_3_END_IDENTIFIER).\ must_next() stop_index = markers.index @@ -124,13 +129,16 @@ def verify(pv): # - Description: Harness instructs device to send an ICMPv6 Echo Request to Router_4. # - Pass Criteria: Router_4 MUST send an ICMPv6 Echo Reply to Router_3. print("Step 6: Router_3") + pkts.filter_ping_request().\ filter_ipv6_src(ROUTER_3_MLEID).\ filter_ipv6_dst(ROUTER_4_MLEID).\ + filter(lambda p: p.icmpv6.echo.identifier == ECHO_IDENTIFIER).\ must_next() pkts.filter_ping_reply().\ filter_ipv6_src(ROUTER_4_MLEID).\ filter_ipv6_dst(ROUTER_3_MLEID).\ + filter(lambda p: p.icmpv6.echo.identifier == ECHO_IDENTIFIER).\ must_next()