diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
index e38132c5b3d58d6158d1c5e2ca572d1a81a363e9..5fb2973d4a382d39d0566d880d30b670c23a59c5 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
@@ -242,8 +242,8 @@ public function testInvalidDisplayPlugins() {
     $this->assertResponse(200);
     $this->assertText(t('The plugin (invalid) did not specify an instance class.'));
 
-    // Rebuild the menu, and ensure that the path is not accessible anymore.
-    menu_router_rebuild();
+    // Rebuild the router, and ensure that the path is not accessible anymore.
+    views_invalidate_cache();
 
     $this->drupalGet('test_display_invalid');
     $this->assertResponse(404);
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index d8e0712361e31a3bafc23ad870ad9852ddda5019..c238f4f77c56f7b464e2e7ec23d5391a1ca96896 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -312,9 +312,6 @@ function views_permission() {
  * Implement hook_menu().
  */
 function views_menu() {
-  // Any event which causes a menu rebuild could potentially mean that the
-  // Views data is updated -- module changes, profile changes, etc.
-  views_invalidate_cache();
   $items = array();
   $items['views/ajax'] = array(
     'title' => 'Views',