Commit 8a9ec9d
[Bugfix]Adding conditions to longer matching entries in conditional marks (sonic-net#14912)
What is the motivation for this PR?
As part of sonic-net#11968, a bugfix was introduced in the find_longest_matches function to identify only the longest matching entry in tests_mark_conditions.yaml.
The previous bug led to incorrect behavior in finding the matching entries, deviating from our intended logic before:
Our expected behavior was to retrieve only the longest matching entry and evaluate the conditions under this single, unique entry.
Instead, the bug caused the function to retrieve all entries matching the test case prefix, evaluating conditions from all matching entries.
This resulted in an unintended situation where conditions from shorter matching entries which are absent in the longest one would still be considered during evaluation.
In PR sonic-net#14395, we optimized the logic for finding marks in conditional marking. Now, although we will retrieve all entries matching the test case prefix but only the longest matching entry is evaluated if the mark is identical across all matching entries, which aligns with our original expectations. Additionally, conditions that exist only in shorter matching entries with the same mark are now ignored. To maintain consistency with previous behavior(although unexpected), we have added these conditions to the longer matching entry.
How did you do it?
To maintain consistency with previous behavior(although unexpected), we have added these conditions to the longer matching entry.1 parent dd7271d commit 8a9ec9d
2 files changed
Lines changed: 249 additions & 108 deletions
File tree
- tests/common/plugins/conditional_mark
0 commit comments