diff --git a/core/modules/simpletest/simpletest.api.php b/core/modules/simpletest/simpletest.api.php
index d1b5f442c7..fbb24f9f11 100644
--- a/core/modules/simpletest/simpletest.api.php
+++ b/core/modules/simpletest/simpletest.api.php
@@ -29,6 +29,12 @@ function hook_simpletest_alter(&$groups) {
  * A test group has started.
  *
  * This hook is called just once at the beginning of a test group.
+ *
+ * This hook is only invoked by the Simpletest UI builder. It will not be
+ * invoked by run-tests.sh or the phpunit tool.
+ *
+ * @deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.0. Convert
+ *   your test to a PHPUnit-based one and implement test listeners.
  */
 function hook_test_group_started() {
 }
@@ -37,6 +43,12 @@ function hook_test_group_started() {
  * A test group has finished.
  *
  * This hook is called just once at the end of a test group.
+ *
+ * This hook is only invoked by the Simpletest UI builder. It will not be
+ * invoked by run-tests.sh or the phpunit tool.
+ *
+ * @deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.0. Convert
+ *   your test to a PHPUnit-based one and implement test listeners.
  */
 function hook_test_group_finished() {
 }
@@ -46,11 +58,17 @@ function hook_test_group_finished() {
  *
  * This hook is called when an individual test has finished.
  *
+ * This hook is only invoked by the Simpletest UI builder. It will not be
+ * invoked by run-tests.sh or the phpunit tool.
+ *
  * @param
  *   $results The results of the test as gathered by
  *   \Drupal\simpletest\WebTestBase.
  *
  * @see \Drupal\simpletest\WebTestBase::results()
+ *
+ * @deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.0. Convert
+ *   your test to a PHPUnit-based one and implement test listeners.
  */
 function hook_test_finished($results) {
 }
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 7d72aa44bc..def87f53a1 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -161,6 +161,7 @@ function simpletest_run_tests($test_list) {
   batch_set($batch);
 
   \Drupal::moduleHandler()->invokeAll('test_group_started');
+  system_trigger_deprecated_hook_error('test_group_started');
 
   return $test_id;
 }
@@ -421,6 +422,7 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
     $test = new $test_class($test_id);
     $test->run();
     \Drupal::moduleHandler()->invokeAll('test_finished', [$test->results]);
+    system_trigger_deprecated_hook_error('test_finished');
     $test_results[$test_class] = $test->results;
   }
   $size = count($test_list);
@@ -483,6 +485,7 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
     drupal_set_message(t('Use the <em>Clean environment</em> button to clean-up temporary files and tables.'), 'warning');
   }
   \Drupal::moduleHandler()->invokeAll('test_group_finished');
+  system_trigger_deprecated_hook_error('test_group_finished');
 }
 
 /**
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index a1a6b715a3..cb406ea6fa 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1489,3 +1489,31 @@ function system_query_entity_reference_alter(AlterableInterface $query) {
   $handler = $query->getMetadata('entity_reference_selection_handler');
   $handler->entityQueryAlter($query);
 }
+
+
+/**
+ * Helper function to trigger errors for deprecated hooks.
+ *
+ * Call this function with the same hook name as
+ * ModuleHandlerInterface::invokeAll(), and it will trigger a deprecation error
+ * if any enabled module implements that hook.
+ *
+ * @param string $deprecated_hook
+ *   The name of the deprecated hook, such as 'test_finished'.
+ */
+function system_trigger_deprecated_hook_error($deprecated_hook) {
+  $implements_deprecated = [];
+
+  $module_handler = \Drupal::moduleHandler();
+  $modules = array_keys($module_handler->getModuleList());
+
+  foreach ($modules as $module) {
+    if ($module_handler->implementsHook($module, $deprecated_hook)) {
+      $implements_deprecated[] = $module;
+    }
+  }
+
+  if (!empty($implements_deprecated)) {
+    @trigger_error('The following modules implement the deprecated hook ' . $deprecated_hook . ': ' . implode(', ', $implements_deprecated), E_USER_DEPRECATED);
+  }
+}
