diff --git a/core/includes/common.inc b/core/includes/common.inc
index 4f78db1..065ec06 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -864,9 +864,9 @@ function drupal_http_request($url, array $options = array()) {
   // user-agent is used to ensure that multiple testing sessions running at the
   // same time won't interfere with each other as they would if the database
   // prefix were stored statically in a file or database variable.
-  $test_info = &$GLOBALS['drupal_test_info'];
-  if (!empty($test_info['test_run_id'])) {
-    $options['headers']['User-Agent'] = drupal_generate_test_ua($test_info['test_run_id']);
+  $in_test_site = !empty($GLOBALS['drupal_test_info']['test_run_id']);
+  if ($in_test_site) {
+    $options['headers']['User-Agent'] = drupal_generate_test_ua($GLOBALS['drupal_test_info']['test_run_id']);
   }
 
   $request = $options['method'] . ' ' . $path . " HTTP/1.0\r\n";
@@ -931,6 +931,17 @@ function drupal_http_request($url, array $options = array()) {
       // Cookie:, followed by a comma-separated list of one or more cookies.
       $result->headers[$name] .= ',' . trim($value);
     }
+    elseif ($in_test_site && strstr($name, 'x-drupal-assertion-')) {
+      $assertion = unserialize(urldecode(trim($value)));
+      $message = strtr('%type: !message in %function (line %line of %file).', array(
+        '%type' => $assertion[1],
+        '!message' => $assertion[0],
+        '%function' => $assertion[2]['function'],
+        '%line' => $assertion[2]['line'],
+        '%file' => $assertion[2]['file'],
+      ));
+      trigger_error($message, E_USER_ERROR);
+    }
     else {
       $result->headers[$name] = trim($value);
     }
diff --git a/core/modules/update/tests/update_test.module b/core/modules/update/tests/update_test.module
index e7ee43e..bc43000 100644
--- a/core/modules/update/tests/update_test.module
+++ b/core/modules/update/tests/update_test.module
@@ -111,7 +111,10 @@ function update_test_mock_page($project_name) {
   }
 
   $path = drupal_get_path('module', 'update_test');
-  readfile("$path/$project_name.$availability_scenario.xml");
+  $file = "$path/$project_name.$availability_scenario.xml";
+  if (file_exists($file)) {
+    readfile($file);
+  }
 }
 
 /**
