diff --git a/core/modules/simpletest/tests/registry.test b/core/modules/simpletest/tests/registry.test
index bcd8d4e..b2744bd 100644
--- a/core/modules/simpletest/tests/registry.test
+++ b/core/modules/simpletest/tests/registry.test
@@ -140,3 +140,48 @@ CONTENTS;
   }
 
 }
+
+/**
+ * Tests that we can recover from a broken registry.
+ */
+class RegistryRecoveryTestCase extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Registry recover test',
+      'description' => 'Test that we can recover from a broken registry.',
+      'group' => 'System'
+    );
+  }
+
+  public function setUp() {
+    parent::setUp('registry_test');
+    $this->drupalLogin($this->drupalCreateUser(array('administer site configuration', 'administer software updates')));
+  }
+
+  /**
+   * Tests that we can recover from a broken registry.
+   */
+  public function testBrokenRegistryRecover() {
+    // Visit the front page and confirm that it runs.
+    $this->drupalGet('');
+    $this->assertText('Successfully loaded RegistryTestClass');
+
+    // Break the registry and confirm that we get a fatal error.
+    variable_set('clean_url', TRUE);
+    variable_set('registry_test_break_the_registry', TRUE);
+    registry_rebuild();
+    $this->drupalGet('');
+    $this->assertNoText('Successfully loaded RegistryTestClass');
+
+    // Visit update.php and confirm that we can load the page.
+    $this->drupalGet('core/update.php');
+    $this->assertText('Drupal database update');
+
+    // Visit the front page again and confirm that it runs.
+    $this->drupalGet('');
+    $this->assertText('Successfully loaded RegistryTestClass');
+  }
+}
+
diff --git a/core/modules/simpletest/tests/registry_test.class.inc b/core/modules/simpletest/tests/registry_test.class.inc
new file mode 100644
index 0000000..76cd322
--- /dev/null
+++ b/core/modules/simpletest/tests/registry_test.class.inc
@@ -0,0 +1,4 @@
+<?php
+
+class RegistryTestClass {}
+
diff --git a/core/modules/simpletest/tests/registry_test.info b/core/modules/simpletest/tests/registry_test.info
new file mode 100644
index 0000000..a4e68a7
--- /dev/null
+++ b/core/modules/simpletest/tests/registry_test.info
@@ -0,0 +1,7 @@
+name = Registry test
+description = Support module for registry testing.
+package = Testing
+version = VERSION
+core = 8.x
+hidden = TRUE
+files[] = registry_test.class.inc
diff --git a/core/modules/simpletest/tests/registry_test.module b/core/modules/simpletest/tests/registry_test.module
new file mode 100644
index 0000000..df0acd8
--- /dev/null
+++ b/core/modules/simpletest/tests/registry_test.module
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Implements hook_registry_files_alter().
+ */
+function registry_test_registry_files_alter(&$files, $modules) {
+  if (variable_get('registry_test_break_the_registry', FALSE)) {
+    unset($files[drupal_get_path('module', 'registry_test') . '/registry_test.class.inc']);
+  }
+}
+
+/**
+ * Implements hook_init().
+ */
+function registry_test_init() {
+  $oh_hai_thar = new RegistryTestClass();
+  drupal_set_message('Successfully loaded RegistryTestClass');
+}
+
diff --git a/core/update.php b/core/update.php
index dd338a2..bf074a4 100644
--- a/core/update.php
+++ b/core/update.php
@@ -392,6 +392,8 @@ if (empty($op) && update_access_allowed()) {
   // stage, since the real requirements check happens further down.
   update_check_requirements(TRUE);
 
+  update_rebuild_registry();
+
   // Redirect to the update information page if all requirements were met.
   install_goto('core/update.php?op=info');
 }
