[nexus] fix flakiness in test 1.1.6.1.4 (#12617)

This commit fixes an occasional failure in Nexus test 1.1.6.1.4
by introducing a controlled delay during the DUT attachment
process.

The test ensures the DUT picks a REED with better connectivity
as its parent. The failure was caused by a race condition where
the intended parent (router3) could upgrade from REED to active
router before the DUT completed its parent selection. This
resulted in the DUT attaching during the first Parent Request
(active routers only), rather than the second request (including
REEDs), which is required for specification compliance.

Changes:
- Added kParentSelectionTime constant (2000ms) to define the
  expected parent selection window.
- Updated test_1_1_6_1_4.cpp to use AdvanceTime() with this
  constant before allowing router3 to upgrade. This ensures
  router3 remains a REED long enough for the DUT to send the
  multicast Parent Request with the REED scan mask.
This commit is contained in:
Jonathan Hui
2026-03-04 17:41:43 -06:00
committed by GitHub
parent 6ea7f24e1c
commit 67e8cfd31b
+6
View File
@@ -56,6 +56,11 @@ static constexpr uint32_t kAttachToRouterTime = 200 * 1000;
*/
static constexpr uint32_t kAttachTime = 20 * 1000;
/**
* Time for the DUT to perform parent discovery scans, in milliseconds.
*/
static constexpr uint32_t kParentSelectionTime = 2000;
/**
* Time to wait for ICMPv6 Echo response, in milliseconds.
*/
@@ -248,6 +253,7 @@ void Test6_1_4(void)
/**
* Enable REED_1 (Router 3) to upgrade to router.
*/
nexus.AdvanceTime(kParentSelectionTime);
router3.Get<Mle::Mle>().SetRouterUpgradeThreshold(kDefaultThreshold);
Log("---------------------------------------------------------------------------------------");