diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 0fb4e39..70d608e 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -684,6 +684,8 @@ public function run(array $methods = array()) {
       foreach ($class_methods as $method) {
         // If the current method starts with "test", run it - it's a test.
         if (strtolower(substr($method, 0, 4)) == 'test') {
+          // Record the start time of the test for calculating test duration.
+          $start_time = time();
           // Insert a fail record. This will be deleted on completion to ensure
           // that testing completed.
           $method_info = new ReflectionMethod($class, $method);
@@ -709,6 +711,9 @@ public function run(array $methods = array()) {
           }
           // Remove the completion check record.
           TestBase::deleteAssert($completion_check_id);
+          // Save the test duration.
+          $duration = time() - $start_time;
+          TestBase::insertAssert($this->testId, $class, TRUE, $duration, 'Duration', $caller);
         }
       }
     }
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index a4641f6..306b8ae 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
@@ -225,7 +225,7 @@ function confirmStubTestResults() {
 
     $this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
 
-    $this->assertEqual('6 passes, 5 fails, 2 exceptions, and 1 debug message', $this->childTestResults['summary'], 'Stub test summary is correct');
+    $this->assertEqual('9 passes, 5 fails, 2 exceptions, and 1 debug message', $this->childTestResults['summary'], 'Stub test summary is correct');
 
     $this->test_ids[] = $test_id = $this->getTestIdFromResults();
     $this->assertTrue($test_id, 'Found test ID in results.');
@@ -306,7 +306,7 @@ function getResultFieldSet() {
     $all_details = $this->xpath('//details');
     $info = $this->getInfo();
     foreach ($all_details as $details) {
-      if ($this->asText($details->summary) == $info['name']) {
+      if ($this->startsWith($this->asText($details->summary), $info['name'])) {
         return $details;
       }
     }
@@ -314,6 +314,20 @@ function getResultFieldSet() {
   }
 
   /**
+   * Checks if the given haystack (text) starts with the given needle (text).
+   *
+   * @param $haystack
+   *   Haystack (text) to search from.
+   * @param $needle
+   *   Needle (text) to search for.
+   * @return
+   *   TRUE if haystack starts with needle, FALSE otherwise.
+   */
+  function startsWith($haystack, $needle) {
+    return !strncmp($haystack, $needle, strlen($needle));
+  }
+
+  /**
    * Extract the text contained by the element.
    *
    * @param $element
diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc
index d5e8c5f..d9f1a1c 100644
--- a/core/modules/simpletest/simpletest.pages.inc
+++ b/core/modules/simpletest/simpletest.pages.inc
@@ -268,6 +268,12 @@ function simpletest_result_form($form, &$form_state, $test_id) {
 
       $group_summary['#' . $assertion->status]++;
       $form['result']['summary']['#' . $assertion->status]++;
+
+      // Display test duration in test group title.
+      if ($assertion->message_group == 'Duration') {
+        $duration = t('@duration sec', array('@duration' => $assertion->message));
+        $form['result']['results'][$group]['#title'] .= ' (' . $duration . ')';
+      }
     }
     $form['result']['results'][$group]['table'] = array(
       '#theme' => 'table',
