You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance conditional mark logic with use_longest for special cases (sonic-net#17317)
What is the motivation for this PR?
In PR sonic-net#16930, we refined the logic of conditional marking to ensure that the longest matching entry with a True condition is prioritized. If the condition for the longest match is False, we then consider the next longest match.
However, there is a special case where the longest match has a False condition, but we still want to adopt this False condition instead of falling back to shorter matches. For example, in a skip scenario:
Shorter matching entries have True conditions, meaning the test should be skipped.
The longest matching entry has a False condition, meaning the test should not be skipped.
In this case, we actually want to respect the longest match and not skip the test.
To address this, this PR introduces a new key, use_longest. When use_longest is set to True, only the conditions of the longest matching entry will be used, ensuring the intended behavior in such edge cases.
How did you do it?
To address this, this PR introduces a new key, use_longest. When use_longest is set to True, only the conditions of the longest matching entry will be used, ensuring the intended behavior in such edge cases.
How did you verify/test it?
Add unit test test cases
0 commit comments