tests: Fix unstable test due to list(set(l)) not preserving order