Fix properties recipe to sort properties dict for determinism.

R=tandrii@chromium.org

Bug: 910369
Change-Id: I86447714d928fd456e69a53336bdd191bf48f875
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/1616984
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
diff --git a/recipe_modules/properties/examples/full.expected/basic.json b/recipe_modules/properties/examples/full.expected/basic.json
index 7acb56a..59de423 100644
--- a/recipe_modules/properties/examples/full.expected/basic.json
+++ b/recipe_modules/properties/examples/full.expected/basic.json
@@ -30,27 +30,6 @@
   {
     "cmd": [
       "echo",
-      "u'thing'"
-    ],
-    "name": "echo param_name_test"
-  },
-  {
-    "cmd": [
-      "echo",
-      "True"
-    ],
-    "name": "echo arbitrary_property"
-  },
-  {
-    "cmd": [
-      "echo",
-      "(u'some', u'strings')"
-    ],
-    "name": "echo list"
-  },
-  {
-    "cmd": [
-      "echo",
       "FrozenDict([('test_prop', FrozenDict([('key', u'value')]))])"
     ],
     "name": "echo $fake_repo/fake_module"
@@ -58,13 +37,6 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
-    ],
-    "name": "echo recipe"
-  },
-  {
-    "cmd": [
-      "echo",
       "FrozenDict([('debug_dir', None)])"
     ],
     "name": "echo $recipe_engine/source_manifest"
@@ -72,6 +44,13 @@
   {
     "cmd": [
       "echo",
+      "True"
+    ],
+    "name": "echo arbitrary_property"
+  },
+  {
+    "cmd": [
+      "echo",
       "FrozenDict([(u'cool', u'dictionary')])"
     ],
     "name": "echo dict"
@@ -79,6 +58,27 @@
   {
     "cmd": [
       "echo",
+      "(u'some', u'strings')"
+    ],
+    "name": "echo list"
+  },
+  {
+    "cmd": [
+      "echo",
+      "u'thing'"
+    ],
+    "name": "echo param_name_test"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'properties:examples/full'"
+    ],
+    "name": "echo recipe"
+  },
+  {
+    "cmd": [
+      "echo",
       "FrozenDict([('key', u'value')])"
     ],
     "name": "echo test_prop"
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_generic.json b/recipe_modules/properties/examples/full.expected/buildbot_generic.json
index c27479c..dd09cba 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_generic.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_generic.json
@@ -32,41 +32,6 @@
   {
     "cmd": [
       "echo",
-      "'/path/to/workdir/TestSlavename'"
-    ],
-    "name": "echo workdir"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'TestBuilder'"
-    ],
-    "name": "echo buildername"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'properties:examples/full'"
-    ],
-    "name": "echo recipe"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'chromium.testing.master'"
-    ],
-    "name": "echo mastername"
-  },
-  {
-    "cmd": [
-      "echo",
-      "571"
-    ],
-    "name": "echo buildnumber"
-  },
-  {
-    "cmd": [
-      "echo",
       "FrozenDict([('debug_dir', None)])"
     ],
     "name": "echo $recipe_engine/source_manifest"
@@ -81,6 +46,13 @@
   {
     "cmd": [
       "echo",
+      "'test_bot'"
+    ],
+    "name": "echo bot_id"
+  },
+  {
+    "cmd": [
+      "echo",
       "'http://c.org/p/cr/'"
     ],
     "name": "echo buildbotURL"
@@ -88,6 +60,34 @@
   {
     "cmd": [
       "echo",
+      "'TestBuilder'"
+    ],
+    "name": "echo buildername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "571"
+    ],
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'properties:examples/full'"
+    ],
+    "name": "echo recipe"
+  },
+  {
+    "cmd": [
+      "echo",
       "'TestSlavename'"
     ],
     "name": "echo slavename"
@@ -95,9 +95,9 @@
   {
     "cmd": [
       "echo",
-      "'test_bot'"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_git_scheduled.json b/recipe_modules/properties/examples/full.expected/buildbot_git_scheduled.json
index 3793619..8b9e783 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_git_scheduled.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_git_scheduled.json
@@ -36,55 +36,6 @@
   {
     "cmd": [
       "echo",
-      "''"
-    ],
-    "name": "echo project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'/path/to/workdir/TestSlavename'"
-    ],
-    "name": "echo workdir"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'https://chromium.googlesource.com/chromium/src.git'"
-    ],
-    "name": "echo repository"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'TestBuilder'"
-    ],
-    "name": "echo buildername"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'properties:examples/full'"
-    ],
-    "name": "echo recipe"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'chromium.testing.master'"
-    ],
-    "name": "echo mastername"
-  },
-  {
-    "cmd": [
-      "echo",
-      "571"
-    ],
-    "name": "echo buildnumber"
-  },
-  {
-    "cmd": [
-      "echo",
       "FrozenDict([('debug_dir', None)])"
     ],
     "name": "echo $recipe_engine/source_manifest"
@@ -99,6 +50,13 @@
   {
     "cmd": [
       "echo",
+      "'test_bot'"
+    ],
+    "name": "echo bot_id"
+  },
+  {
+    "cmd": [
+      "echo",
       "'master'"
     ],
     "name": "echo branch"
@@ -113,6 +71,48 @@
   {
     "cmd": [
       "echo",
+      "'TestBuilder'"
+    ],
+    "name": "echo buildername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "571"
+    ],
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "''"
+    ],
+    "name": "echo project"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'properties:examples/full'"
+    ],
+    "name": "echo recipe"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://chromium.googlesource.com/chromium/src.git'"
+    ],
+    "name": "echo repository"
+  },
+  {
+    "cmd": [
+      "echo",
       "'c14d891d44f0afff64e56ed7c9702df1d807b1ee'"
     ],
     "name": "echo revision"
@@ -127,9 +127,9 @@
   {
     "cmd": [
       "echo",
-      "'test_bot'"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_scheduled.json b/recipe_modules/properties/examples/full.expected/buildbot_scheduled.json
index 3793619..8b9e783 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_scheduled.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_scheduled.json
@@ -36,55 +36,6 @@
   {
     "cmd": [
       "echo",
-      "''"
-    ],
-    "name": "echo project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'/path/to/workdir/TestSlavename'"
-    ],
-    "name": "echo workdir"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'https://chromium.googlesource.com/chromium/src.git'"
-    ],
-    "name": "echo repository"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'TestBuilder'"
-    ],
-    "name": "echo buildername"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'properties:examples/full'"
-    ],
-    "name": "echo recipe"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'chromium.testing.master'"
-    ],
-    "name": "echo mastername"
-  },
-  {
-    "cmd": [
-      "echo",
-      "571"
-    ],
-    "name": "echo buildnumber"
-  },
-  {
-    "cmd": [
-      "echo",
       "FrozenDict([('debug_dir', None)])"
     ],
     "name": "echo $recipe_engine/source_manifest"
@@ -99,6 +50,13 @@
   {
     "cmd": [
       "echo",
+      "'test_bot'"
+    ],
+    "name": "echo bot_id"
+  },
+  {
+    "cmd": [
+      "echo",
       "'master'"
     ],
     "name": "echo branch"
@@ -113,6 +71,48 @@
   {
     "cmd": [
       "echo",
+      "'TestBuilder'"
+    ],
+    "name": "echo buildername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "571"
+    ],
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "''"
+    ],
+    "name": "echo project"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'properties:examples/full'"
+    ],
+    "name": "echo recipe"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://chromium.googlesource.com/chromium/src.git'"
+    ],
+    "name": "echo repository"
+  },
+  {
+    "cmd": [
+      "echo",
       "'c14d891d44f0afff64e56ed7c9702df1d807b1ee'"
     ],
     "name": "echo revision"
@@ -127,9 +127,9 @@
   {
     "cmd": [
       "echo",
-      "'test_bot'"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_tryserver.json b/recipe_modules/properties/examples/full.expected/buildbot_tryserver.json
index a15132e..a8a0869 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_tryserver.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_tryserver.json
@@ -40,30 +40,30 @@
   {
     "cmd": [
       "echo",
-      "12"
+      "FrozenDict([('debug_dir', None)])"
     ],
-    "name": "echo patch_set"
+    "name": "echo $recipe_engine/source_manifest"
   },
   {
     "cmd": [
       "echo",
-      "'/path/to/workdir/TestSlavename'"
+      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
     ],
-    "name": "echo workdir"
+    "name": "echo blamelist"
   },
   {
     "cmd": [
       "echo",
-      "'https://chromium-review.googlesource.com'"
+      "'test_bot'"
     ],
-    "name": "echo patch_gerrit_url"
+    "name": "echo bot_id"
   },
   {
     "cmd": [
       "echo",
-      "'master'"
+      "'http://c.org/p/cr/'"
     ],
-    "name": "echo patch_branch"
+    "name": "echo buildbotURL"
   },
   {
     "cmd": [
@@ -75,9 +75,44 @@
   {
     "cmd": [
       "echo",
-      "'TestSlavename'"
+      "571"
     ],
-    "name": "echo slavename"
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'master'"
+    ],
+    "name": "echo patch_branch"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://chromium-review.googlesource.com'"
+    ],
+    "name": "echo patch_gerrit_url"
+  },
+  {
+    "cmd": [
+      "echo",
+      "456789"
+    ],
+    "name": "echo patch_issue"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium/src'"
+    ],
+    "name": "echo patch_project"
   },
   {
     "cmd": [
@@ -96,9 +131,9 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
+      "12"
     ],
-    "name": "echo recipe"
+    "name": "echo patch_set"
   },
   {
     "cmd": [
@@ -110,58 +145,23 @@
   {
     "cmd": [
       "echo",
-      "'chromium.testing.master'"
+      "'properties:examples/full'"
     ],
-    "name": "echo mastername"
+    "name": "echo recipe"
   },
   {
     "cmd": [
       "echo",
-      "571"
+      "'TestSlavename'"
     ],
-    "name": "echo buildnumber"
+    "name": "echo slavename"
   },
   {
     "cmd": [
       "echo",
-      "FrozenDict([('debug_dir', None)])"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo $recipe_engine/source_manifest"
-  },
-  {
-    "cmd": [
-      "echo",
-      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
-    ],
-    "name": "echo blamelist"
-  },
-  {
-    "cmd": [
-      "echo",
-      "456789"
-    ],
-    "name": "echo patch_issue"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'http://c.org/p/cr/'"
-    ],
-    "name": "echo buildbotURL"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'chromium/src'"
-    ],
-    "name": "echo patch_project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'test_bot'"
-    ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit.json b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit.json
index 85286d7..a342604 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit.json
@@ -40,30 +40,30 @@
   {
     "cmd": [
       "echo",
-      "12"
+      "FrozenDict([('debug_dir', None)])"
     ],
-    "name": "echo patch_set"
+    "name": "echo $recipe_engine/source_manifest"
   },
   {
     "cmd": [
       "echo",
-      "'/path/to/workdir/TestSlavename'"
+      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
     ],
-    "name": "echo workdir"
+    "name": "echo blamelist"
   },
   {
     "cmd": [
       "echo",
-      "'https://chromium-review.googlesource.com'"
+      "'test_bot'"
     ],
-    "name": "echo patch_gerrit_url"
+    "name": "echo bot_id"
   },
   {
     "cmd": [
       "echo",
-      "'master'"
+      "'http://c.org/p/cr/'"
     ],
-    "name": "echo patch_branch"
+    "name": "echo buildbotURL"
   },
   {
     "cmd": [
@@ -75,9 +75,44 @@
   {
     "cmd": [
       "echo",
-      "'TestSlavename'"
+      "571"
     ],
-    "name": "echo slavename"
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'master'"
+    ],
+    "name": "echo patch_branch"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://chromium-review.googlesource.com'"
+    ],
+    "name": "echo patch_gerrit_url"
+  },
+  {
+    "cmd": [
+      "echo",
+      "456789"
+    ],
+    "name": "echo patch_issue"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'infra/infra'"
+    ],
+    "name": "echo patch_project"
   },
   {
     "cmd": [
@@ -96,9 +131,9 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
+      "12"
     ],
-    "name": "echo recipe"
+    "name": "echo patch_set"
   },
   {
     "cmd": [
@@ -110,58 +145,23 @@
   {
     "cmd": [
       "echo",
-      "'chromium.testing.master'"
+      "'properties:examples/full'"
     ],
-    "name": "echo mastername"
+    "name": "echo recipe"
   },
   {
     "cmd": [
       "echo",
-      "571"
+      "'TestSlavename'"
     ],
-    "name": "echo buildnumber"
+    "name": "echo slavename"
   },
   {
     "cmd": [
       "echo",
-      "FrozenDict([('debug_dir', None)])"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo $recipe_engine/source_manifest"
-  },
-  {
-    "cmd": [
-      "echo",
-      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
-    ],
-    "name": "echo blamelist"
-  },
-  {
-    "cmd": [
-      "echo",
-      "456789"
-    ],
-    "name": "echo patch_issue"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'http://c.org/p/cr/'"
-    ],
-    "name": "echo buildbotURL"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'infra/infra'"
-    ],
-    "name": "echo patch_project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'test_bot'"
-    ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_both.json b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_both.json
index a610062..90b3fed 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_both.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_both.json
@@ -40,30 +40,30 @@
   {
     "cmd": [
       "echo",
-      "3"
+      "FrozenDict([('debug_dir', None)])"
     ],
-    "name": "echo patch_set"
+    "name": "echo $recipe_engine/source_manifest"
   },
   {
     "cmd": [
       "echo",
-      "'/path/to/workdir/TestSlavename'"
+      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
     ],
-    "name": "echo workdir"
+    "name": "echo blamelist"
   },
   {
     "cmd": [
       "echo",
-      "'https://gerrit.my.host'"
+      "'test_bot'"
     ],
-    "name": "echo patch_gerrit_url"
+    "name": "echo bot_id"
   },
   {
     "cmd": [
       "echo",
-      "'master'"
+      "'http://c.org/p/cr/'"
     ],
-    "name": "echo patch_branch"
+    "name": "echo buildbotURL"
   },
   {
     "cmd": [
@@ -75,9 +75,44 @@
   {
     "cmd": [
       "echo",
-      "'TestSlavename'"
+      "571"
     ],
-    "name": "echo slavename"
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'master'"
+    ],
+    "name": "echo patch_branch"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://gerrit.my.host'"
+    ],
+    "name": "echo patch_gerrit_url"
+  },
+  {
+    "cmd": [
+      "echo",
+      "989898"
+    ],
+    "name": "echo patch_issue"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'custom'"
+    ],
+    "name": "echo patch_project"
   },
   {
     "cmd": [
@@ -96,9 +131,9 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
+      "3"
     ],
-    "name": "echo recipe"
+    "name": "echo patch_set"
   },
   {
     "cmd": [
@@ -110,58 +145,23 @@
   {
     "cmd": [
       "echo",
-      "'chromium.testing.master'"
+      "'properties:examples/full'"
     ],
-    "name": "echo mastername"
+    "name": "echo recipe"
   },
   {
     "cmd": [
       "echo",
-      "571"
+      "'TestSlavename'"
     ],
-    "name": "echo buildnumber"
+    "name": "echo slavename"
   },
   {
     "cmd": [
       "echo",
-      "FrozenDict([('debug_dir', None)])"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo $recipe_engine/source_manifest"
-  },
-  {
-    "cmd": [
-      "echo",
-      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
-    ],
-    "name": "echo blamelist"
-  },
-  {
-    "cmd": [
-      "echo",
-      "989898"
-    ],
-    "name": "echo patch_issue"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'http://c.org/p/cr/'"
-    ],
-    "name": "echo buildbotURL"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'custom'"
-    ],
-    "name": "echo patch_project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'test_bot'"
-    ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_gerrit.json b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_gerrit.json
index 955a150..f64a5b5 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_gerrit.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_gerrit.json
@@ -40,30 +40,30 @@
   {
     "cmd": [
       "echo",
-      "12"
+      "FrozenDict([('debug_dir', None)])"
     ],
-    "name": "echo patch_set"
+    "name": "echo $recipe_engine/source_manifest"
   },
   {
     "cmd": [
       "echo",
-      "'/path/to/workdir/TestSlavename'"
+      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
     ],
-    "name": "echo workdir"
+    "name": "echo blamelist"
   },
   {
     "cmd": [
       "echo",
-      "'https://chrome-internal-review.googlesource.com'"
+      "'test_bot'"
     ],
-    "name": "echo patch_gerrit_url"
+    "name": "echo bot_id"
   },
   {
     "cmd": [
       "echo",
-      "'master'"
+      "'http://c.org/p/cr/'"
     ],
-    "name": "echo patch_branch"
+    "name": "echo buildbotURL"
   },
   {
     "cmd": [
@@ -75,9 +75,44 @@
   {
     "cmd": [
       "echo",
-      "'TestSlavename'"
+      "571"
     ],
-    "name": "echo slavename"
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'master'"
+    ],
+    "name": "echo patch_branch"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://chrome-internal-review.googlesource.com'"
+    ],
+    "name": "echo patch_gerrit_url"
+  },
+  {
+    "cmd": [
+      "echo",
+      "456789"
+    ],
+    "name": "echo patch_issue"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'infra/internal'"
+    ],
+    "name": "echo patch_project"
   },
   {
     "cmd": [
@@ -96,9 +131,9 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
+      "12"
     ],
-    "name": "echo recipe"
+    "name": "echo patch_set"
   },
   {
     "cmd": [
@@ -110,58 +145,23 @@
   {
     "cmd": [
       "echo",
-      "'chromium.testing.master'"
+      "'properties:examples/full'"
     ],
-    "name": "echo mastername"
+    "name": "echo recipe"
   },
   {
     "cmd": [
       "echo",
-      "571"
+      "'TestSlavename'"
     ],
-    "name": "echo buildnumber"
+    "name": "echo slavename"
   },
   {
     "cmd": [
       "echo",
-      "FrozenDict([('debug_dir', None)])"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo $recipe_engine/source_manifest"
-  },
-  {
-    "cmd": [
-      "echo",
-      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
-    ],
-    "name": "echo blamelist"
-  },
-  {
-    "cmd": [
-      "echo",
-      "456789"
-    ],
-    "name": "echo patch_issue"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'http://c.org/p/cr/'"
-    ],
-    "name": "echo buildbotURL"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'infra/internal'"
-    ],
-    "name": "echo patch_project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'test_bot'"
-    ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_git.json b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_git.json
index 1e40ad1..ecf4dbe 100644
--- a/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_git.json
+++ b/recipe_modules/properties/examples/full.expected/buildbot_tryserver_gerrit_override_git.json
@@ -40,30 +40,30 @@
   {
     "cmd": [
       "echo",
-      "12"
+      "FrozenDict([('debug_dir', None)])"
     ],
-    "name": "echo patch_set"
+    "name": "echo $recipe_engine/source_manifest"
   },
   {
     "cmd": [
       "echo",
-      "'/path/to/workdir/TestSlavename'"
+      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
     ],
-    "name": "echo workdir"
+    "name": "echo blamelist"
   },
   {
     "cmd": [
       "echo",
-      "'https://chrome-internal-review.googlesource.com'"
+      "'test_bot'"
     ],
-    "name": "echo patch_gerrit_url"
+    "name": "echo bot_id"
   },
   {
     "cmd": [
       "echo",
-      "'master'"
+      "'http://c.org/p/cr/'"
     ],
-    "name": "echo patch_branch"
+    "name": "echo buildbotURL"
   },
   {
     "cmd": [
@@ -75,9 +75,44 @@
   {
     "cmd": [
       "echo",
-      "'TestSlavename'"
+      "571"
     ],
-    "name": "echo slavename"
+    "name": "echo buildnumber"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'chromium.testing.master'"
+    ],
+    "name": "echo mastername"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'master'"
+    ],
+    "name": "echo patch_branch"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'https://chrome-internal-review.googlesource.com'"
+    ],
+    "name": "echo patch_gerrit_url"
+  },
+  {
+    "cmd": [
+      "echo",
+      "456789"
+    ],
+    "name": "echo patch_issue"
+  },
+  {
+    "cmd": [
+      "echo",
+      "'infra/hidden'"
+    ],
+    "name": "echo patch_project"
   },
   {
     "cmd": [
@@ -96,9 +131,9 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
+      "12"
     ],
-    "name": "echo recipe"
+    "name": "echo patch_set"
   },
   {
     "cmd": [
@@ -110,58 +145,23 @@
   {
     "cmd": [
       "echo",
-      "'chromium.testing.master'"
+      "'properties:examples/full'"
     ],
-    "name": "echo mastername"
+    "name": "echo recipe"
   },
   {
     "cmd": [
       "echo",
-      "571"
+      "'TestSlavename'"
     ],
-    "name": "echo buildnumber"
+    "name": "echo slavename"
   },
   {
     "cmd": [
       "echo",
-      "FrozenDict([('debug_dir', None)])"
+      "'/path/to/workdir/TestSlavename'"
     ],
-    "name": "echo $recipe_engine/source_manifest"
-  },
-  {
-    "cmd": [
-      "echo",
-      "('cool_dev1337@chromium.org', 'hax@chromium.org')"
-    ],
-    "name": "echo blamelist"
-  },
-  {
-    "cmd": [
-      "echo",
-      "456789"
-    ],
-    "name": "echo patch_issue"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'http://c.org/p/cr/'"
-    ],
-    "name": "echo buildbotURL"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'infra/hidden'"
-    ],
-    "name": "echo patch_project"
-  },
-  {
-    "cmd": [
-      "echo",
-      "'test_bot'"
-    ],
-    "name": "echo bot_id"
+    "name": "echo workdir"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.expected/odd_name.json b/recipe_modules/properties/examples/full.expected/odd_name.json
index bfd3b9d..f7b760e 100644
--- a/recipe_modules/properties/examples/full.expected/odd_name.json
+++ b/recipe_modules/properties/examples/full.expected/odd_name.json
@@ -32,16 +32,16 @@
   {
     "cmd": [
       "echo",
-      "'properties:examples/full'"
+      "'blarp'"
     ],
-    "name": "echo recipe"
+    "name": "echo foo.bar-bam"
   },
   {
     "cmd": [
       "echo",
-      "'blarp'"
+      "'properties:examples/full'"
     ],
-    "name": "echo foo.bar-bam"
+    "name": "echo recipe"
   },
   {
     "jsonResult": null,
diff --git a/recipe_modules/properties/examples/full.py b/recipe_modules/properties/examples/full.py
index f8ecbbe..682eddf 100644
--- a/recipe_modules/properties/examples/full.py
+++ b/recipe_modules/properties/examples/full.py
@@ -24,7 +24,7 @@
 
   # It should behave like a real dictionary.
   assert len(properties) == len(api.properties)
-  for k in api.properties:
+  for k in sorted(api.properties):
     api.step('echo %s' % k, ['echo', repr(api.properties[k])])