From 5f4c83ebf693f017e77834c0a83a8c9ae520dd01 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Sep 18 2017 12:24:48 +0000 Subject: Fix flaky test for package moves By processing the architectures in alphabetical order, we avoid occasional failure in the test suite. Signed-off-by: Lubomír Sedlář --- diff --git a/compose_utils/package_moves.py b/compose_utils/package_moves.py index 2193fc1..869ae5b 100644 --- a/compose_utils/package_moves.py +++ b/compose_utils/package_moves.py @@ -129,7 +129,7 @@ class ComposePackageMoves(object): available_arches |= set(new_variant_data.keys()) available_arches |= set(new_parent_variant_data.keys()) - for arch in available_arches: + for arch in sorted(available_arches): old_variant_pkgs = old_variant_data.get(arch, {}) old_parent_variant_pkgs = old_parent_variant_data.get(arch, {}) new_variant_pkgs = new_variant_data.get(arch, {}) diff --git a/tests/fixtures/move-report.json b/tests/fixtures/move-report.json index e3d009d..5125f41 100644 --- a/tests/fixtures/move-report.json +++ b/tests/fixtures/move-report.json @@ -5,6 +5,20 @@ }, "moved_items": [ { + "arch": "s390x", + "from": "Server", + "items": {}, + "parent": "Server", + "to": "Server-optional" + }, + { + "arch": "s390x", + "from": "Server-optional", + "items": {}, + "parent": "Server", + "to": "Server" + }, + { "arch": "x86_64", "from": "Server", "items": { @@ -48,20 +62,6 @@ "items": {}, "parent": "Server", "to": "Server" - }, - { - "arch": "s390x", - "from": "Server", - "items": {}, - "parent": "Server", - "to": "Server-optional" - }, - { - "arch": "s390x", - "from": "Server-optional", - "items": {}, - "parent": "Server", - "to": "Server" } ], "new_items": {