Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.92
diff -u -r1.92 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	30 Mar 2009 05:35:35 -0000	1.92
+++ modules/simpletest/drupal_web_test_case.php	15 Apr 2009 15:09:00 -0000
@@ -889,8 +889,11 @@
    */
   protected function refreshVariables() {
     global $conf;
+
+    // Make sure custom variables set in settings.php are not lost.
+    $custom_conf = array_diff_key($conf, variable_init());
     cache_clear_all('variables', 'cache');
-    $conf = variable_init();
+    $conf = variable_init($custom_conf);
   }
 
   /**
