diff --git a/core/lib/Drupal/Core/Entity/EntityTypeManager.php b/core/lib/Drupal/Core/Entity/EntityTypeManager.php
index abe96a5..9115da2 100644
--- a/core/lib/Drupal/Core/Entity/EntityTypeManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityTypeManager.php
@@ -6,6 +6,7 @@
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\DependencyInjection\ClassResolverInterface;
+use Drupal\Core\Entity\Annotation\EntityType;
 use Drupal\Core\Entity\Exception\InvalidLinkTemplateException;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
@@ -79,7 +80,6 @@ public function __construct(\Traversable $namespaces, ModuleHandlerInterface $mo
     $this->setCacheBackend($cache, 'entity_type', ['entity_types']);
     $this->alterInfo('entity_type');
 
-    $this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, 'Drupal\Core\Entity\Annotation\EntityType');
     $this->stringTranslation = $string_translation;
     $this->classResolver = $class_resolver;
   }
@@ -87,6 +87,16 @@ public function __construct(\Traversable $namespaces, ModuleHandlerInterface $mo
   /**
    * {@inheritdoc}
    */
+  protected function getDiscovery() {
+    if (!$this->discovery) {
+      $this->discovery = new AnnotatedClassDiscovery('Entity', $this->namespaces, EntityType::class);
+    }
+    return $this->discovery;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function processDefinition(&$definition, $plugin_id) {
     /** @var \Drupal\Core\Entity\EntityTypeInterface $definition */
     parent::processDefinition($definition, $plugin_id);
diff --git a/core/lib/Drupal/Core/Extension/ThemeInstaller.php b/core/lib/Drupal/Core/Extension/ThemeInstaller.php
index db1226f..91c6a51 100644
--- a/core/lib/Drupal/Core/Extension/ThemeInstaller.php
+++ b/core/lib/Drupal/Core/Extension/ThemeInstaller.php
@@ -265,9 +265,6 @@ public function uninstall(array $theme_list) {
     $extension_config->save(TRUE);
     $this->state->set('system.theme.data', $current_theme_data);
 
-
-    // @todo Remove system_list().
-    $this->themeHandler->refreshInfo();
     $this->resetSystem();
 
     $this->moduleHandler->invokeAll('themes_uninstalled', [$theme_list]);
@@ -277,9 +274,15 @@ public function uninstall(array $theme_list) {
    * Resets some other systems like rebuilding the route information or caches.
    */
   protected function resetSystem() {
+    // Clear plugin manager caches.
+    \Drupal::getContainer()->get('plugin.cache_clearer')->clearCachedDefinitions();
+
+    $this->themeHandler->refreshInfo();
+
     if ($this->routeBuilder) {
       $this->routeBuilder->setRebuildNeeded();
     }
+    // @todo Remove system_list().
     $this->systemListReset();
 
     // @todo It feels wrong to have the requirement to clear the local tasks
diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
index 5a8a3f3..37ae627 100644
--- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
+++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
@@ -191,6 +191,7 @@ public function clearCachedDefinitions() {
       }
     }
     $this->definitions = NULL;
+    $this->discovery = NULL;
   }
 
   /**
diff --git a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
index dc81757..80c3df0 100644
--- a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
+++ b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
@@ -20,6 +20,9 @@ class BreakpointDiscoveryTest extends KernelTestBase {
 
   protected function setUp() {
     parent::setUp();
+
+    // Fetch the definitions before installing the theme to prime the cache.
+    \Drupal::service('breakpoint.manager')->getDefinitions();
     \Drupal::service('theme_handler')->install(['breakpoint_theme_test']);
   }
 
