diff --git a/core/modules/system/tests/modules/session_test/session_test.routing.yml b/core/modules/system/tests/modules/session_test/session_test.routing.yml
index b044fc4..accd2c8 100644
--- a/core/modules/system/tests/modules/session_test/session_test.routing.yml
+++ b/core/modules/system/tests/modules/session_test/session_test.routing.yml
@@ -60,14 +60,6 @@ session_test.set_message_but_dont_save:
   requirements:
     _access: 'TRUE'
 
-session_test.set_not_started:
-  path: '/session-test/set-not-started'
-  defaults:
-    _title: 'Set message when session is not started'
-    _content: '\Drupal\session_test\Controller\SessionTestController::setNotStarted'
-  requirements:
-    _access: 'TRUE'
-
 session_test.is_logged_in:
   path: '/session-test/is-logged-in'
   defaults:
diff --git a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php
index 5993056..9deae9f 100644
--- a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php
+++ b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php
@@ -115,20 +115,6 @@ public function setMessageButDontSave() {
   }
 
   /**
-   * Stores a value in $_SESSION['session_test_value'] without
-   * having started the session in advance.
-   *
-   * @return string
-   *   A notification message.
-   */
-  public function setNotStarted() {
-    if (!drupal_session_will_start()) {
-      $this->set($this->t('Session was not started'));
-    }
-    return ['#markup' => ''];
-  }
-
-  /**
    * Only available if current user is logged in.
    *
    * @return string
