From d64bdee1bb3d4a024b1124f0222a6f989daa1d52 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Sat, 21 Mar 2026 20:31:47 -0500 Subject: [PATCH] [nexus] fix intermittent failure in Test 1-2-BBR-TC-2 (#12738) Nexus test 1_2_BBR_TC_2 was occasionally failing at Step 14. In this step, the previous leader (Router_1) is disabled, and the DUT (BR_1) is expected to become the new leader and the Primary Backbone Router (BBR). The original wait time was 200 seconds (kAttachToRouterTime). However, analysis showed that routers wait for the MLE Router ID Timeout (120 seconds) before initiating a new leader election. Combined with election jitter and BBR registration time, this sometimes exceeded the 200-second window. This commit increases the wait time in Step 14 to 400 seconds (kAttachToRouterTime * 2) to provide sufficient buffer for the leader transition and BBR registration, effectively resolving the flake. --- tests/nexus/test_1_2_BBR_TC_2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/nexus/test_1_2_BBR_TC_2.cpp b/tests/nexus/test_1_2_BBR_TC_2.cpp index 2a94ca527..05744fee7 100644 --- a/tests/nexus/test_1_2_BBR_TC_2.cpp +++ b/tests/nexus/test_1_2_BBR_TC_2.cpp @@ -49,6 +49,11 @@ static constexpr uint32_t kAttachToRouterTime = 200 * 1000; */ static constexpr uint32_t kStabilizationTime = 10 * 1000; +/** + * Time to advance for leader failover and BBR promotion, in milliseconds. + */ +static constexpr uint32_t kLeaderFailoverTime = 400 * 1000; + /** * Partition weight for Router_1 to ensure it becomes leader. */ @@ -357,7 +362,7 @@ void Test_1_2_BBR_TC_2(void) */ Log("Step 14: BR_1 (DUT) becomes Leader and Primary BBR"); - nexus.AdvanceTime(kAttachToRouterTime); + nexus.AdvanceTime(kLeaderFailoverTime); // Time for leader failover and BBR promotion (milliseconds) VerifyOrQuit(br1.Get().IsLeader()); VerifyOrQuit(br1.Get().IsPrimary());