Commit 706e93f
authored
[nexus] fix flaky nexus test router_downgrade_on_sec_policy_change (openthread#12959)
The test was failing occasionally due to the unpredictable timing of
tick-aligned timers and dataset propagation in simulations.
Specifically:
1) The router's jittered timeout (minimum 1 second) could expire
in as little as 1ms if an MLE TimeTick occurred immediately
after the security policy update.
2) Dataset propagation via MLE Advertisements could take up to
32 seconds, making immediate checks on the router's role
unreliable.
This commit fixes the flakiness by:
- Replacing flaky router role checks with `IsRouterRoleAllowed()`
assertions. This verifies that the security policy has been
successfully propagated and applied, regardless of whether the
actual role transition has completed.
- Increasing the propagation wait time to 5 seconds. This provides
a safe margin for simulated radio propagation while remaining
well within the leader's 10-second downgrade delay.
- Ensuring both the leader and router are verified for policy
application in both phases of the test.
- Maintaining the final checks to ensure both nodes eventually
become detached after the full downgrade delay (150 seconds).
The fix was verified with 1000 consecutive successful iterations.1 parent 0a97d56 commit 706e93f
1 file changed
Lines changed: 17 additions & 11 deletions
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | 108 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
177 | 184 | | |
178 | | - | |
| 185 | + | |
179 | 186 | | |
180 | | - | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| |||
0 commit comments