diff --git a/core/lib/Drupal/Core/Update/UpdateRegistry.php b/core/lib/Drupal/Core/Update/UpdateRegistry.php
index 0190e04..cc2f8b0 100644
--- a/core/lib/Drupal/Core/Update/UpdateRegistry.php
+++ b/core/lib/Drupal/Core/Update/UpdateRegistry.php
@@ -112,6 +112,8 @@ protected function getAvailableUpdateFunctions() {
       }
     }
 
+    // Ensure that the update order is deterministic.
+    sort($updates);
     return $updates;
   }
 
diff --git a/core/modules/system/src/Tests/Update/UpdatePostUpdateTest.php b/core/modules/system/src/Tests/Update/UpdatePostUpdateTest.php
index 85f3247..5c49557 100644
--- a/core/modules/system/src/Tests/Update/UpdatePostUpdateTest.php
+++ b/core/modules/system/src/Tests/Update/UpdatePostUpdateTest.php
@@ -34,7 +34,7 @@ protected function doSelectionTest() {
 
     // Ensure that normal and post_update updates are merged together on the
     // selection page.
-    $this->assertRaw('<ul><li>8001 -   Normal update_N() function. </li><li>First update.</li><li>Second update.</li><li>Test1 update.</li><li>Test0 update.</li><li>Testing batch processing in post updates update.</li></ul>');
+    $this->assertRaw('<ul><li>8001 -   Normal update_N() function. </li><li>First update.</li><li>Second update.</li><li>Test0 update.</li><li>Test1 update.</li><li>Testing batch processing in post updates update.</li></ul>');
   }
 
   /**
@@ -58,8 +58,8 @@ public function testPostUpdate() {
     $updates = [
       'update_test_postupdate_post_update_first',
       'update_test_postupdate_post_update_second',
-      'update_test_postupdate_post_update_test1',
       'update_test_postupdate_post_update_test0',
+      'update_test_postupdate_post_update_test1',
       'update_test_postupdate_post_update_test_batch-1',
       'update_test_postupdate_post_update_test_batch-2',
       'update_test_postupdate_post_update_test_batch-3',
