From fc9b0cbb7fe718cbbd63e3b51839b90b3e558037 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 26 Oct 2020 06:13:38 -0400 Subject: stabilize sets that are converted to lists The order of elements in sets cannot be relied upon, because the hash values are randomized by Python. Whenever sets are converted to lists we need to keep their order stable, or random changes in the command line cause ninja to rebuild a lot of files unnecessarily. To stabilize them, use either sort or OrderedSet. Sorting is not always applicable, but it can be faster because it's done in C and it can produce slightly nicer output. --- run_unittests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 7f7df36..9815058 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1187,7 +1187,7 @@ class InternalTests(unittest.TestCase): ]: d = mesonbuild.depfile.DepFile(f) deps = d.get_all_dependencies(target) - self.assertEqual(deps, expdeps) + self.assertEqual(sorted(deps), sorted(expdeps)) def test_log_once(self): f = io.StringIO() -- cgit v1.1