diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php
index a83f41bddc601b4eacde05c12c8bb327b12cf3eb..1aa6a444c50b4b5f83722ba72d4c6f1b889c1d6b 100644
--- a/core/modules/system/src/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/src/Tests/Common/AddFeedTest.php
@@ -61,9 +61,15 @@ function testBasicFeedAddNoTitle() {
       $build['#attached']['feed'][] = [$feed_info['url'], $feed_info['title']];
     }
 
-    drupal_process_attached($build);
+    // Use the bare HTML page renderer to render our links.
+    $renderer = $this->container->get('bare_html_page_renderer');
+    $response = $renderer->renderBarePage(
+      $build, '', $this->container->get('theme.manager')->getActiveTheme()->getName()
+    );
+    // Glean the content from the response object.
+    $this->setRawContent($response->getContent());
 
-    $this->setRawContent(drupal_get_html_head());
+    // Assert that the content contains the RSS links we specified.
     foreach ($urls as $description => $feed_info) {
       $this->assertPattern($this->urlToRSSLinkPattern($feed_info['url'], $feed_info['title']), format_string('Found correct feed header for %description', array('%description' => $description)));
     }
diff --git a/core/modules/system/src/Tests/Common/RenderTest.php b/core/modules/system/src/Tests/Common/RenderTest.php
index 11bb96abd92bc4a7edb32c63554d8db0042d8dc5..94ad431e8768669aa7f7d65412486b6882097c32 100644
--- a/core/modules/system/src/Tests/Common/RenderTest.php
+++ b/core/modules/system/src/Tests/Common/RenderTest.php
@@ -53,17 +53,17 @@ function testDrupalRenderThemePreprocessAttached() {
   }
 
   /**
-   * Tests drupal_process_attached().
+   * Tests that we get an exception when we try to attach an illegal type.
    */
   public function testDrupalProcessAttached() {
     // Specify invalid attachments in a render array.
     $build['#attached']['library'][] = 'core/drupal.states';
     $build['#attached']['drupal_process_states'][] = [];
     try {
-      drupal_process_attached($build);
+      $this->render($build);
       $this->fail("Invalid #attachment 'drupal_process_states' allowed");
     }
-    catch (\Exception $e) {
+    catch (\LogicException $e) {
       $this->pass("Invalid #attachment 'drupal_process_states' not allowed");
     }
   }
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index d9c5dfc6324aed1d390fd05500b4e3a117a5c67c..565329f67a6862acc64581a797e944190326d785 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -222,8 +222,6 @@ protected function ajaxFormWrapper($form_class, FormStateInterface &$form_state)
     }
     $output = $renderer->renderRoot($form);
 
-    drupal_process_attached($form);
-
     // These forms have the title built in, so set the title here:
     $title = $form_state->get('title') ?: '';
 
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index a09227b058b5ff80ba5041e17eced685e45b753f..74a885e26dede3365bb34c011e1792776f07ebb5 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -869,9 +869,14 @@ protected function disableModules(array $modules) {
    *   The rendered string output (typically HTML).
    */
   protected function render(array &$elements) {
-    $content = $this->container->get('renderer')->render($elements);
-    drupal_process_attached($elements);
-    $this->setRawContent($content);
+    // Use the bare HTML page renderer to render our links.
+    $renderer = $this->container->get('bare_html_page_renderer');
+    $response = $renderer->renderBarePage(
+      $build, '', $this->container->get('theme.manager')->getActiveTheme()->getName()
+    );
+
+    // Glean the content from the response object.
+    $this->setRawContent($response->getContent());
     $this->verbose('<pre style="white-space: pre-wrap">' . Html::escape($content));
     return $content;
   }