selftests: tc-testing: preserve list order when removing duplicates
Subsystems (4)
PATCH 1/1 selftests: tc-testing: preserve list order when removing duplicates
From: Naveen Anandhan <[email protected]>
Using set() removes duplicates but breaks ordering.
Test output should be deterministic, so replace with dict.fromkeys().
Signed-off-by Naveen Anandhan <[email protected]>
--- tools/testing/selftests/tc-testing/tdc_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/tc-testing/tdc_helper.py +2 -2
@@ -16,9 +16,9 @@ def get_categorized_testlist(alltests, ucat): def get_unique_item(lst): - """ For a list, return a list of the unique items in the list. """ + """Return unique items while preserving original order.""" if len(lst) > 1: - return list(set(lst)) + return list(dict.fromkeys(lst)) else: return lst
Signature · 1 line
2.43.0
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Sun, 22 Feb 2026 15:25:36 +0530 you wrote:
From: Naveen Anandhan <[email protected]>
Using
set()removes duplicates but breaks ordering.
Test output should be deterministic, so replace withdict.fromkeys().Signed-off-by Naveen Anandhan <[email protected]>[...]
Here is the summary with links:
- selftests: tc-testing: preserve list order when removing duplicates
https://git.kernel.org/netdev/net-next/c/8ac768bb198c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html