diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 751a729..a6c0222 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -464,6 +464,10 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
     drupal_set_message(t('The test run finished in @elapsed.', array('@elapsed' => $elapsed)));
   }
   else {
+    // We have to register test namespaces so that core-level test-related
+    // classes are available.
+    \Drupal::service('test_discovery')->registerTestNamespaces();
+
     // Use the test_id passed as a parameter to _simpletest_batch_operation().
     $test_id = $operations[0][1][1];
 
