diff --git a/core/core.services.yml b/core/core.services.yml
index 20b8651..4b1200d 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -7,8 +7,6 @@ services:
   cache.backend.database:
     class: Drupal\Core\Cache\DatabaseBackendFactory
     arguments: ['@database']
-  cache.backend.memory:
-    class: Drupal\Core\Cache\MemoryBackendFactory
   cache.bootstrap:
     class: Drupal\Core\Cache\CacheBackendInterface
     tags:
diff --git a/core/lib/Drupal/Core/DependencyInjection/UpdateServiceProvider.php b/core/lib/Drupal/Core/DependencyInjection/UpdateServiceProvider.php
index d458665..5f78c54 100644
--- a/core/lib/Drupal/Core/DependencyInjection/UpdateServiceProvider.php
+++ b/core/lib/Drupal/Core/DependencyInjection/UpdateServiceProvider.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
+use Symfony\Component\DependencyInjection\Reference;
 
 /**
  * ServiceProvider class for update.php service overrides.
@@ -35,7 +36,15 @@ public function register(ContainerBuilder $container) {
     $container->register('module_handler', 'Drupal\Core\Extension\UpdateModuleHandler')
       ->addArgument('%container.modules%');
     $container
-      ->register("cache_factory", 'Drupal\Core\Cache\MemoryBackendFactory');
+      ->register("cache_factory", 'Drupal\Core\Cache\CacheFactory')
+      ->addArgument(new Reference('settings'));
+    $container
+      ->register('cache.backend.memory', 'Drupal\Core\Cache\MemoryBackendFactory');
+    foreach (array('bootstrap', 'config', 'cache', 'menu', 'page', 'path') as $bin) {
+      $container
+        ->register("cache.$bin", 'Drupal\Core\Cache\MemoryBackend')
+        ->addArgument($bin);
+    }
     $container
       ->register('router.builder', 'Drupal\Core\Routing\RouteBuilderStatic');
   }
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index 5eb5b26..6b5882e 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -147,6 +147,7 @@ public function containerBuild(ContainerBuilder $container) {
     $this->container = $container;
 
     $container->register('lock', 'Drupal\Core\Lock\NullLockBackend');
+    $container->register('cache.backend.memory', 'Drupal\Core\Cache\MemoryBackendFactory');
     $this->settingsSet('cache', array('default' => 'cache.backend.memory'));
 
     $container
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 284df1d..800e90c 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -749,6 +749,7 @@ protected function setUp() {
     // search path to the child site's search paths.
     // @see drupal_system_listing()
     $conf['simpletest_parent_profile'] = $this->originalProfile;
+    $conf['container_service_providers']['WebTestServiceProvider'] = 'Drupal\simpletest\WebTestServiceProvider';
 
     // Define information about the user 1 account.
     $this->root_user = new UserSession(array(
@@ -775,6 +776,7 @@ protected function setUp() {
         NestedArray::setValue($GLOBALS['conf'], array_merge(array($config_base), explode('.', $name)), $value);
       }
     }
+
     $this->settingsSet('file_public_path', $this->public_files_directory);
     // Execute the non-interactive installer.
     require_once DRUPAL_ROOT . '/core/includes/install.core.inc';
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestServiceProvider.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestServiceProvider.php
new file mode 100644
index 0000000..d00625c
--- /dev/null
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestServiceProvider.php
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\simpletest\WebTestServiceProvider.
+ */
+
+namespace Drupal\simpletest;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\ServiceProviderInterface;
+
+/**
+ * Service provider for web tests.
+ */
+class WebTestServiceProvider implements ServiceProviderInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  function register(ContainerBuilder $container) {
+    // Add the memory backend cache factory.
+    $container->register('cache.backend.memory', 'Drupal\Core\Cache\MemoryBackendFactory');
+  }
+
+}
