diff --git a/modules/system/system.install b/modules/system/system.install
index 323b7b3..ed7ba59 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -532,6 +532,9 @@ function system_install() {
   module_list(TRUE);
   module_implements('', FALSE, TRUE);
 
+  // Ensure the schema versions are not based on a previous module list.
+  drupal_static_reset('drupal_get_schema_versions');
+
   // Load system theme data appropriately.
   system_rebuild_theme_data();
 
diff --git a/modules/system/system.test b/modules/system/system.test
index 95b4353..0542adf 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -2355,6 +2355,20 @@ class UpdateScriptFunctionalTest extends DrupalWebTestCase {
   }
 
   /**
+   * Tests that there are no pending updates for the first test method.
+   */
+  function testNoPendingUpdates() {
+    // Ensure that for the first test method in a class, there are no pending
+    // updates. This tests a drupal_get_schema_versions() bug that previously
+    // led to the wrong schema version being recorded for the initial install
+    // of a child site during automated testing.
+    $this->drupalLogin($this->update_user);
+    $this->drupalGet($this->update_url, array('external' => TRUE));
+    $this->drupalPost(NULL, array(), t('Continue'));
+    $this->assertText(t('No pending updates.'), 'End of update process was reached.');
+  }
+
+  /**
    * Tests access to the update script.
    */
   function testUpdateAccess() {
