diff --git a/core/modules/block/src/Tests/BlockInstallTest.php b/core/modules/block/src/Tests/BlockInstallTest.php
index 84819e6..374ba31 100644
--- a/core/modules/block/src/Tests/BlockInstallTest.php
+++ b/core/modules/block/src/Tests/BlockInstallTest.php
@@ -25,7 +25,6 @@ public function testCacheTagInvalidationUponInstallation() {
     // Install the block module, and place the "Powered by Drupal" block.
     $this->container->get('module_installer')->install(['block', 'shortcut']);
     $this->rebuildContainer();
-    $this->container->get('router.builder')->rebuild();
     $this->drupalPlaceBlock('system_powered_by_block');
 
     // Check the same page, block.module's hook_install() should have
diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
index 1164ba0..ee274e0 100644
--- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
@@ -59,7 +59,6 @@ protected function setUp() {
 
     // Comment rendering generates links, so build the router.
     $this->installSchema('system', array('router'));
-    $this->container->get('router.builder')->rebuild();
 
     // Set up a field, so that the entity that'll be referenced bubbles up a
     // cache tag when rendering it entirely.
diff --git a/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php b/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php
index 4545e46..ac2fe56 100644
--- a/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php
+++ b/core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php
@@ -42,9 +42,6 @@ protected function setUp() {
     $this->installSchema('system', ['router']);
     $this->installConfig(['comment']);
 
-    // The entity.node.canonical route must exist when the RDF hook is called.
-    $this->container->get('router.builder')->rebuild();
-
     $this->migrateContent();
     $this->executeMigrations([
       'd6_comment_type',
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php
index f987494..c794474 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php
@@ -53,7 +53,6 @@ protected function setUp() {
     \Drupal::service('content_translation.manager')->setEnabled('node', 'article', TRUE);
     drupal_static_reset();
     \Drupal::entityManager()->clearCachedDefinitions();
-    \Drupal::service('router.builder')->rebuild();
     \Drupal::service('entity.definition_update_manager')->applyUpdates();
 
     $this->baseUser1 = $this->drupalCreateUser(['access content overview']);
diff --git a/core/modules/editor/src/Tests/EditorImageDialogTest.php b/core/modules/editor/src/Tests/EditorImageDialogTest.php
index b1745b0..cd92153 100644
--- a/core/modules/editor/src/Tests/EditorImageDialogTest.php
+++ b/core/modules/editor/src/Tests/EditorImageDialogTest.php
@@ -76,7 +76,6 @@ protected function setUp() {
     $type->save();
     node_add_body_field($type);
     $this->installEntitySchema('user');
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/field/src/Tests/String/RawStringFormatterTest.php b/core/modules/field/src/Tests/String/RawStringFormatterTest.php
index 60ea420..a5d3722 100644
--- a/core/modules/field/src/Tests/String/RawStringFormatterTest.php
+++ b/core/modules/field/src/Tests/String/RawStringFormatterTest.php
@@ -59,7 +59,6 @@ protected function setUp() {
     // Configure the theme system.
     $this->installConfig(array('system', 'field'));
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
     $this->installEntitySchema('entity_test');
 
     $this->entityType = 'entity_test';
diff --git a/core/modules/field/src/Tests/String/StringFormatterTest.php b/core/modules/field/src/Tests/String/StringFormatterTest.php
index 1703c3e..28ec21c 100644
--- a/core/modules/field/src/Tests/String/StringFormatterTest.php
+++ b/core/modules/field/src/Tests/String/StringFormatterTest.php
@@ -59,7 +59,6 @@ protected function setUp() {
     // Configure the theme system.
     $this->installConfig(array('system', 'field'));
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
     $this->installEntitySchema('entity_test_rev');
 
     $this->entityType = 'entity_test_rev';
diff --git a/core/modules/field/src/Tests/String/UuidFormatterTest.php b/core/modules/field/src/Tests/String/UuidFormatterTest.php
index 92554bf..af34d3f 100644
--- a/core/modules/field/src/Tests/String/UuidFormatterTest.php
+++ b/core/modules/field/src/Tests/String/UuidFormatterTest.php
@@ -33,7 +33,6 @@ protected function setUp() {
 
     $this->installConfig(['system', 'field']);
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
     $this->installEntitySchema('entity_test');
   }
 
diff --git a/core/modules/filter/src/Tests/TextFormatElementFormTest.php b/core/modules/filter/src/Tests/TextFormatElementFormTest.php
index b889c4a..56450ff 100644
--- a/core/modules/filter/src/Tests/TextFormatElementFormTest.php
+++ b/core/modules/filter/src/Tests/TextFormatElementFormTest.php
@@ -43,8 +43,6 @@ protected function setUp() {
     $this->installEntitySchema('user');
     $this->installSchema('system', ['sequences', 'router']);
     $this->installConfig(['filter', 'filter_test']);
-    // Filter tips link to the full-page.
-    \Drupal::service('router.builder')->rebuild();
     /* @var \Drupal\Core\Render\ElementInfoManager $manager */
     $manager = \Drupal::service('plugin.manager.element_info');
     $manager->clearCachedDefinitions();
diff --git a/core/modules/hal/src/Tests/EntityTest.php b/core/modules/hal/src/Tests/EntityTest.php
index 6301fb0..68827ab 100644
--- a/core/modules/hal/src/Tests/EntityTest.php
+++ b/core/modules/hal/src/Tests/EntityTest.php
@@ -31,7 +31,6 @@ class EntityTest extends NormalizerTestBase {
   protected function setUp() {
     parent::setUp();
 
-    \Drupal::service('router.builder')->rebuild();
     $this->installSchema('system', array('sequences'));
     $this->installSchema('comment', array('comment_entity_statistics'));
     $this->installEntitySchema('taxonomy_term');
diff --git a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
index fcfe4f8..b28284c 100644
--- a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
+++ b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
@@ -55,7 +55,6 @@
    */
   protected function setUp() {
     parent::setUp();
-    $this->container->get('router.builder')->rebuild();
 
     $this->fieldStorageDefinition = array(
       'field_name' => $this->fieldName,
diff --git a/core/modules/rest/src/Tests/RestLinkManagerTest.php b/core/modules/rest/src/Tests/RestLinkManagerTest.php
index 4adee7c..5bb97f3 100644
--- a/core/modules/rest/src/Tests/RestLinkManagerTest.php
+++ b/core/modules/rest/src/Tests/RestLinkManagerTest.php
@@ -26,7 +26,6 @@ class RestLinkManagerTest extends KernelTestBase {
   protected function setUp() {
     parent::setUp();
     $this->installSchema('system', ['router']);
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/serialization/src/Tests/EntityResolverTest.php b/core/modules/serialization/src/Tests/EntityResolverTest.php
index f63d96d..baa34e4 100644
--- a/core/modules/serialization/src/Tests/EntityResolverTest.php
+++ b/core/modules/serialization/src/Tests/EntityResolverTest.php
@@ -32,8 +32,6 @@ class EntityResolverTest extends NormalizerTestBase {
   protected function setUp() {
     parent::setUp();
 
-    \Drupal::service('router.builder')->rebuild();
-
     // Create the test field storage.
     entity_create('field_storage_config', array(
       'entity_type' => 'entity_test_mulrev',
diff --git a/core/modules/serialization/src/Tests/NormalizerTestBase.php b/core/modules/serialization/src/Tests/NormalizerTestBase.php
index c38c554..3540a28 100644
--- a/core/modules/serialization/src/Tests/NormalizerTestBase.php
+++ b/core/modules/serialization/src/Tests/NormalizerTestBase.php
@@ -25,7 +25,6 @@ protected function setUp() {
     $this->installEntitySchema('user');
     $this->installSchema('system', array('url_alias', 'router'));
     $this->installConfig(array('field'));
-    \Drupal::service('router.builder')->rebuild();
     \Drupal::moduleHandler()->invoke('rest', 'install');
 
     // Auto-create a field for testing.
diff --git a/core/modules/simpletest/src/RouteProvider.php b/core/modules/simpletest/src/RouteProvider.php
new file mode 100644
index 0000000..6c32fb6
--- /dev/null
+++ b/core/modules/simpletest/src/RouteProvider.php
@@ -0,0 +1,130 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\ProxyClass\Routing\RouteProvider.
+ */
+
+/**
+ * This file was generated via php core/scripts/generate-proxy-class.php 'Drupal\Core\Routing\RouteProvider' "core/lib/Drupal".
+ */
+
+namespace Drupal\simpletest;
+
+use Drupal\Core\Routing\PreloadableRouteProviderInterface;
+use Symfony\Cmf\Component\Routing\PagedRouteProviderInterface;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Provides a proxy class for \Drupal\Core\Routing\RouteProvider.
+ *
+ * @see \Drupal\Component\ProxyBuilder
+ */
+class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProviderInterface, EventSubscriberInterface {
+
+  use \Drupal\Core\DependencyInjection\DependencySerializationTrait;
+
+  /**
+   * Lazy loads the real service from the container.
+   *
+   * @return \Drupal\Core\Routing\PreloadableRouteProviderInterface|\Symfony\Cmf\Component\Routing\PagedRouteProviderInterface|\Symfony\Component\EventDispatcher\EventSubscriberInterface
+   *   Returns the constructed real service.
+   */
+  protected function lazyLoadItself() {
+    if (!isset($this->service)) {
+      $container = \Drupal::getContainer();
+      $this->service = $container->get('simpletest.router.route_provider');
+      $container->set('router.route_provider', $this->service);
+      $container->get('router.builder')->rebuild();
+      return $this->service ;
+    }
+
+    return $this->service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRouteCollectionForRequest(Request $request) {
+    return $this->lazyLoadItself()->getRouteCollectionForRequest($request);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRouteByName($name) {
+    return $this->lazyLoadItself()->getRouteByName($name);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function preLoadRoutes($names){
+    return $this->lazyLoadItself()->preLoadRoutes($names);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRoutesByNames($names) {
+    return $this->lazyLoadItself()->getRoutesByNames($names);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getCandidateOutlines(array $parts) {
+    return $this->lazyLoadItself()->getCandidateOutlines($parts);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRoutesByPattern($pattern) {
+    return $this->lazyLoadItself()->getRoutesByPattern($pattern);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function routeProviderRouteCompare(array $a, array $b) {
+    return $this->lazyLoadItself()->routeProviderRouteCompare($a, $b);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getAllRoutes() {
+    return $this->lazyLoadItself()->getAllRoutes();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function reset() {
+    return $this->lazyLoadItself()->reset();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getSubscribedEvents() {
+    RouteProvider::getSubscribedEvents();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRoutesPaged($offset, $length = NULL) {
+    return $this->lazyLoadItself()->getRoutesPaged($offset, $length);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRoutesCount() {
+    return $this->lazyLoadItself()->getRoutesCount();
+  }
+
+}
diff --git a/core/modules/simpletest/src/TestServiceProvider.php b/core/modules/simpletest/src/TestServiceProvider.php
index 64dedb8..599cc80 100644
--- a/core/modules/simpletest/src/TestServiceProvider.php
+++ b/core/modules/simpletest/src/TestServiceProvider.php
@@ -8,9 +8,11 @@
 namespace Drupal\simpletest;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\ServiceModifierInterface;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
+use Symfony\Component\DependencyInjection\Definition;
 
-class TestServiceProvider implements ServiceProviderInterface {
+class TestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface {
 
   /**
    * @var \Drupal\simpletest\TestBase;
@@ -25,4 +27,18 @@ function register(ContainerBuilder $container) {
       static::$currentTest->containerBuild($container);
     }
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function alter(ContainerBuilder $container) {
+    if (static::$currentTest instanceof KernelTestBase) {
+      // While $container->get() does a recursive resolve, getDefinition() does
+      // not so do it ourselves.
+      for ($id = 'router.route_provider'; $container->hasAlias($id); $id = (string) $container->getAlias($id));
+      $definition = $container->getDefinition($id);
+      $container->setDefinition('simpletest.router.route_provider', clone $definition);
+      $container->setDefinition('router.route_provider', new Definition('Drupal\simpletest\RouteProvider'));
+    }
+  }
 }
diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php b/core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php
index 92e3644..0c9587f 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php
+++ b/core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php
@@ -45,7 +45,6 @@ public function testFormCacheUsage() {
   public function testBlockForms() {
     $this->container->get('module_installer')->install(['block', 'search']);
     $this->rebuildContainer();
-    $this->container->get('router.builder')->rebuild();
     $this->drupalLogin($this->rootUser);
 
     $this->drupalPlaceBlock('search_form_block', ['weight' => -5]);
diff --git a/core/modules/system/src/Tests/Common/AttachedAssetsTest.php b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
index 7440d99..48623c0 100644
--- a/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
+++ b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
@@ -52,8 +52,6 @@ class AttachedAssetsTest extends KernelTestBase {
   protected function setUp() {
     parent::setUp();
     $this->installSchema('system', array('router'));
-    $this->container->get('router.builder')->rebuild();
-
     $this->assetResolver = $this->container->get('asset.resolver');
     $this->renderer = $this->container->get('renderer');
   }
diff --git a/core/modules/system/src/Tests/Common/PageRenderTest.php b/core/modules/system/src/Tests/Common/PageRenderTest.php
index 1b4c387..a8b70c1 100644
--- a/core/modules/system/src/Tests/Common/PageRenderTest.php
+++ b/core/modules/system/src/Tests/Common/PageRenderTest.php
@@ -22,8 +22,6 @@ class PageRenderTest extends KernelTestBase {
   function testHookPageAttachmentsExceptions() {
     $this->enableModules(['common_test', 'system']);
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
-
     $this->assertPageRenderHookExceptions('common_test', 'hook_page_attachments');
   }
 
@@ -33,8 +31,6 @@ function testHookPageAttachmentsExceptions() {
   function testHookPageAlter() {
     $this->enableModules(['common_test', 'system']);
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
-
     $this->assertPageRenderHookExceptions('common_test', 'hook_page_attachments_alter');
   }
 
diff --git a/core/modules/system/src/Tests/Common/RenderElementTypesTest.php b/core/modules/system/src/Tests/Common/RenderElementTypesTest.php
index b71b9c1..723500a 100644
--- a/core/modules/system/src/Tests/Common/RenderElementTypesTest.php
+++ b/core/modules/system/src/Tests/Common/RenderElementTypesTest.php
@@ -29,7 +29,6 @@ protected function setUp() {
     parent::setUp();
     $this->installConfig(array('system'));
     $this->installSchema('system', array('router'));
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Element/PathElementFormTest.php b/core/modules/system/src/Tests/Element/PathElementFormTest.php
index bcbe534..ebfba8e 100644
--- a/core/modules/system/src/Tests/Element/PathElementFormTest.php
+++ b/core/modules/system/src/Tests/Element/PathElementFormTest.php
@@ -44,7 +44,6 @@ protected function setUp() {
     parent::setUp();
     $this->installSchema('system', ['router', 'sequences', 'key_value_expire']);
     $this->installEntitySchema('user');
-    \Drupal::service('router.builder')->rebuild();
     /** @var \Drupal\user\RoleInterface $role */
     $role = Role::create(array(
       'id' => 'admin',
diff --git a/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php b/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php
index 0fdd9af..c8b28e6 100644
--- a/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php
+++ b/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php
@@ -51,7 +51,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', ['router', 'key_value_expire']);
-    \Drupal::service('router.builder')->rebuild();
 
     $this->testUser = User::create(array(
       'name' => 'foobar1',
diff --git a/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php b/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php
index 4f223e3..d2ed9af 100644
--- a/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php
@@ -30,7 +30,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', ['router', 'key_value']);
-    $this->container->get('router.builder')->rebuild();
 
     $this->installEntitySchema('user');
     $this->installEntitySchema('entity_test_composite_constraint');
diff --git a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php b/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php
index 3096310..b63ea0d 100644
--- a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php
+++ b/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php
@@ -33,7 +33,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Render/Element/TableTest.php b/core/modules/system/src/Tests/Render/Element/TableTest.php
index 725f339..c45fd06 100644
--- a/core/modules/system/src/Tests/Render/Element/TableTest.php
+++ b/core/modules/system/src/Tests/Render/Element/TableTest.php
@@ -30,7 +30,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', 'router');
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php b/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php
index 551e4d8..0fdd38e 100644
--- a/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php
+++ b/core/modules/system/src/Tests/RouteProcessor/RouteNoneTest.php
@@ -43,8 +43,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', ['router']);
-    \Drupal::service('router.builder')->rebuild();
-
     $this->urlGenerator = \Drupal::urlGenerator();
   }
 
diff --git a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php b/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
index bc341a6..addaf1d 100644
--- a/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
+++ b/core/modules/system/src/Tests/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
@@ -42,8 +42,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', ['router']);
-    \Drupal::service('router.builder')->rebuild();
-
     $this->urlGenerator = \Drupal::urlGenerator();
   }
 
diff --git a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php b/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php
index 98515b8..ce6b9d7 100644
--- a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php
+++ b/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php
@@ -32,7 +32,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', ['router', 'url_alias']);
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php b/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
index ee3b6eb..eeaff18 100644
--- a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
+++ b/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
@@ -31,7 +31,6 @@ protected function setUp() {
     parent::setUp();
 
     $this->installSchema('system', ['router']);
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php b/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php
index 95ed3f5..84b5041 100644
--- a/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php
+++ b/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php
@@ -40,8 +40,6 @@ protected function setUp() {
     // Install default system configuration.
     $this->installConfig(array('system'));
     $this->installSchema('system', array('router'));
-    \Drupal::service('router.builder')->rebuild();
-
     $this->interfaceLanguage = \Drupal::languageManager()->getCurrentLanguage();
     $this->tokenService = \Drupal::token();
   }
diff --git a/core/modules/system/src/Tests/System/TrustedHostsTest.php b/core/modules/system/src/Tests/System/TrustedHostsTest.php
index a3b08b8..73f8be0 100644
--- a/core/modules/system/src/Tests/System/TrustedHostsTest.php
+++ b/core/modules/system/src/Tests/System/TrustedHostsTest.php
@@ -85,7 +85,6 @@ public function testFakeRequests() {
   public function testShortcut() {
     $this->container->get('module_installer')->install(['block', 'shortcut']);
     $this->rebuildContainer();
-    $this->container->get('router.builder')->rebuild();
 
     /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */
     $entity_manager = $this->container->get('entity.manager');
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php b/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
index ef87848..d48bf03 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
@@ -72,7 +72,6 @@ protected function enableTranslation() {
     \Drupal::service('content_translation.manager')->setEnabled('taxonomy_term', $this->vocabulary->id(), TRUE);
     drupal_static_reset();
     \Drupal::entityManager()->clearCachedDefinitions();
-    \Drupal::service('router.builder')->rebuild();
     \Drupal::service('entity.definition_update_manager')->applyUpdates();
   }
 
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
index d58b2d5..8456931 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
@@ -93,7 +93,6 @@ function setUp() {
     Views::viewsData()->clear();
 
     ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views'));
-    $this->container->get('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php b/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php
index f69444a..d75b9ad 100644
--- a/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php
+++ b/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php
@@ -59,9 +59,6 @@ protected function setUp() {
     $this->installSchema('node', array('node_access'));
     $this->installConfig(array('node', 'language'));
 
-    // The entity.node.canonical route must exist when nodes are rendered.
-    $this->container->get('router.builder')->rebuild();
-
     $this->langcodes = array(\Drupal::languageManager()->getDefaultLanguage()->getId());
     for ($i = 0; $i < 2; $i++) {
       $langcode = 'l' . $i;
diff --git a/core/modules/views/src/Tests/Plugin/RowEntityTest.php b/core/modules/views/src/Tests/Plugin/RowEntityTest.php
index 9723750..7e79214 100644
--- a/core/modules/views/src/Tests/Plugin/RowEntityTest.php
+++ b/core/modules/views/src/Tests/Plugin/RowEntityTest.php
@@ -41,7 +41,6 @@ protected function setUp() {
 
     $this->installEntitySchema('taxonomy_term');
     $this->installConfig(array('taxonomy'));
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/views/src/Tests/TokenReplaceTest.php b/core/modules/views/src/Tests/TokenReplaceTest.php
index 0462756..d724eb3 100644
--- a/core/modules/views/src/Tests/TokenReplaceTest.php
+++ b/core/modules/views/src/Tests/TokenReplaceTest.php
@@ -29,7 +29,6 @@ class TokenReplaceTest extends ViewKernelTestBase {
   protected function setUp() {
     parent::setUp();
     $this->installSchema('system', 'url_alias');
-    $this->container->get('router.builder')->rebuild();
   }
 
   /**
diff --git a/core/modules/views/src/Tests/ViewKernelTestBase.php b/core/modules/views/src/Tests/ViewKernelTestBase.php
index fe794ea..e664dae 100644
--- a/core/modules/views/src/Tests/ViewKernelTestBase.php
+++ b/core/modules/views/src/Tests/ViewKernelTestBase.php
@@ -70,8 +70,6 @@ protected function setUpFixtures() {
       $this->installSchema('views_test_data', $table);
     }
 
-    \Drupal::service('router.builder')->rebuild();
-
     // Load the test dataset.
     $data_set = $this->dataSet();
     $query = db_insert('views_test_data')
diff --git a/core/modules/views/src/Tests/ViewTestData.php b/core/modules/views/src/Tests/ViewTestData.php
index 536470c..2bfc233 100644
--- a/core/modules/views/src/Tests/ViewTestData.php
+++ b/core/modules/views/src/Tests/ViewTestData.php
@@ -56,9 +56,6 @@ public static function createTestViews($class, array $modules) {
         }
       }
     }
-
-    // Rebuild the router once.
-    \Drupal::service('router.builder')->rebuild();
   }
 
   /**
