Commit 825f90c
refactor: unify result analysis pattern across PfcXoff and IngressDrop executors
PfcXoff used explicit all_true/all_false/all_equal pattern (8 lines).
IngressDrop used concise set-dedup pattern (3 lines). Both produce
identical outcomes for all input combinations.
Unified to the concise pattern with descriptive comment:
return_result = (True, results[0])
# Multiple attempts: check consistency (set dedup detects mixed True/False)
if len(results) > 1 and len(set(results)) > 1:
return_result = (False, False)
UT coverage: PR sonic-net#22545 (e2fca74) — 12 new tests covering all 6 input
combinations for both executors.
Addresses @StormLiangMS review: inconsistent result patterns.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Xu Chen <[email protected]>1 parent 003c1c5 commit 825f90c
2 files changed
Lines changed: 7 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
| 275 | + | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
197 | 183 | | |
198 | 184 | | |
199 | 185 | | |
200 | 186 | | |
201 | | - | |
| 187 | + | |
202 | 188 | | |
203 | | - | |
| 189 | + | |
204 | 190 | | |
205 | 191 | | |
206 | 192 | | |
| |||
0 commit comments