diff --git a/core/modules/simpletest/src/Tests/MissingDependentModuleUnitTest.php b/core/modules/simpletest/src/Tests/MissingDependentModuleUnitTest.php
deleted file mode 100644
index e93d85e..0000000
--- a/core/modules/simpletest/src/Tests/MissingDependentModuleUnitTest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-namespace Drupal\simpletest\Tests;
-
-use Drupal\simpletest\KernelTestBase;
-
-/**
- * This test should not load since it requires a module that is not found.
- *
- * @group simpletest
- * @dependencies simpletest_missing_module
- */
-class MissingDependentModuleUnitTest extends KernelTestBase {
-
-  /**
-   * Ensure that this test will not be loaded despite its dependency.
-   */
-  function testFail() {
-    $this->fail('Running test with missing required module.');
-  }
-
-}
diff --git a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
index c412d99..efc2ae0 100644
--- a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
@@ -4,7 +4,7 @@
 
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Site\Settings;
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -15,28 +15,41 @@
 class DrupalKernelTest extends KernelTestBase {
 
   protected function setUp() {
+    $this->root = static::getDrupalRoot();
+
     // DrupalKernel relies on global $config_directories and requires those
     // directories to exist. Therefore, create the directories, but do not
     // invoke KernelTestBase::setUp(), since that would set up further
-    // environment aspects, which would distort this test, because it tests
-    // the DrupalKernel (re-)building itself.
-    $this->prepareConfigDirectories();
+    // environment aspects.
+    $this->setupTestPrefix();
+    $this->setUpFilesystem();
 
-    $this->settingsSet('php_storage', array('service_container' => array(
+    $this->setSetting('php_storage', array('service_container' => array(
       'bin' => 'service_container',
       'class' => 'Drupal\Component\PhpStorage\MTimeProtectedFileStorage',
-      'directory' => DRUPAL_ROOT . '/' . $this->publicFilesDirectory . '/php',
-      'secret' => Settings::getHashSalt(),
+      'directory' => $this->root . '/' . $this->publicFilesDirectory . '/php',
     )));
   }
 
   /**
-   * {@inheritdoc}
+   * Create and set new configuration directories.
+   *
+   * @see config_get_config_directory()
+   *
+   * @throws \RuntimeException
+   *   Thrown when CONFIG_SYNC_DIRECTORY cannot be created or made writable.
    */
   protected function prepareConfigDirectories() {
-    \Drupal::setContainer($this->originalContainer);
-    parent::prepareConfigDirectories();
-    \Drupal::unsetContainer();
+    include_once $this->root . '/core/includes/install.inc';
+    include_once $this->root . '/core/includes/bootstrap.inc';
+
+    // Assign the relative path to the global variable.
+    $path = $this->siteDirectory . '/config_' . CONFIG_SYNC_DIRECTORY;
+    $GLOBALS['config_directories'][CONFIG_SYNC_DIRECTORY] = $path;
+    // Ensure the directory can be created and is writeable.
+    if (!install_ensure_config_directory(CONFIG_SYNC_DIRECTORY)) {
+      throw new \RuntimeException("Failed to create '" . CONFIG_SYNC_DIRECTORY . "' config directory $path");
+    }
   }
 
   /**
@@ -56,10 +69,10 @@ protected function prepareConfigDirectories() {
    */
   protected function getTestKernel(Request $request, array $modules_enabled = NULL) {
     // Manually create kernel to avoid replacing settings.
-    $class_loader = require DRUPAL_ROOT . '/autoload.php';
+    $class_loader = require $this->root . '/autoload.php';
     $kernel = DrupalKernel::createFromRequest($request, $class_loader, 'testing');
-    $this->settingsSet('container_yamls', []);
-    $this->settingsSet('hash_salt', $this->databasePrefix);
+    $this->setSetting('container_yamls', []);
+    $this->setSetting('hash_salt', $this->databasePrefix);
     if (isset($modules_enabled)) {
       $kernel->updateModules($modules_enabled);
     }
@@ -162,14 +175,17 @@ public function testRepeatedBootWithDifferentEnvironment() {
       'testing2',
     ];
 
+    $containers = [];
     foreach ($environments as $environment) {
       $kernel = DrupalKernel::createFromRequest($request, $class_loader, $environment);
-      $this->settingsSet('container_yamls', []);
-      $this->settingsSet('hash_salt', $this->databasePrefix);
+      $this->setSetting('container_yamls', []);
+      $this->setSetting('hash_salt', $this->databasePrefix);
       $kernel->boot();
+
+      $containers[] = spl_object_hash($kernel->getContainer());
     }
 
-    $this->pass('Repeatedly loaded compiled DIC with different environment');
+    $this->assertSame($containers, array_unique($containers), 'Repeatedly loaded compiled DIC with different environment');
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 08e599a..1a9eeab 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -250,23 +250,10 @@ protected function bootEnvironment() {
     $this->classLoader = require $this->root . '/autoload.php';
 
     require_once $this->root . '/core/includes/bootstrap.inc';
-
-    // Set up virtual filesystem.
-    // Ensure that the generated test site directory does not exist already,
-    // which may happen with a large amount of concurrent threads and
-    // long-running tests.
-    do {
-      $suffix = mt_rand(100000, 999999);
-      $this->siteDirectory = 'sites/simpletest/' . $suffix;
-      $this->databasePrefix = 'simpletest' . $suffix;
-    } while (is_dir($this->root . '/' . $this->siteDirectory));
-
-    // Ensure that all code that relies on drupal_valid_test_ua() can still be
-    // safely executed. This primarily affects the (test) site directory
-    // resolution (used by e.g. LocalStream and PhpStorage).
-    $this->databasePrefix = 'simpletest' . $suffix;
     drupal_valid_test_ua($this->databasePrefix);
 
+    $this->setUpFilesystem();
+
     $settings = array(
       'hash_salt' => get_class($this),
       'file_public_path' => $this->siteDirectory . '/files',
@@ -285,9 +272,31 @@ protected function bootEnvironment() {
   }
 
   /**
+   * Creates the test prefix used for files and the DB.
+   */
+  protected function setupTestPrefix() {
+    // Set up virtual filesystem.
+    // Ensure that the generated test site directory does not exist already,
+    // which may happen with a large amount of concurrent threads and
+    // long-running tests.
+    do {
+      $suffix = mt_rand(100000, 999999);
+      $this->siteDirectory = 'sites/simpletest/' . $suffix;
+      $this->databasePrefix = 'simpletest' . $suffix;
+    } while (is_dir($this->root . '/' . $this->siteDirectory));
+
+    // Ensure that all code that relies on drupal_valid_test_ua() can still be
+    // safely executed. This primarily affects the (test) site directory
+    // resolution (used by e.g. LocalStream and PhpStorage).
+    $this->databasePrefix = 'simpletest' . $suffix;
+  }
+
+  /**
    * Sets up the filesystem, so things like the file directory.
    */
   protected function setUpFilesystem() {
+    include_once $this->root . '/core/includes/bootstrap.inc';
+
     $suffix = str_replace('simpletest', '', $this->databasePrefix);
     $this->vfsRoot = vfsStream::setup('root', NULL, array(
       'sites' => array(
