diff --git a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php
index 2de924c0ed32983965361fb1dc4f8947995a4dd0..0a4cf8a901c35e4ecd8fff0c39c613491aff9299 100644
--- a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php
+++ b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php
@@ -203,7 +203,9 @@ public function testInvalidPluginDefinitions(string $yaml, ?string $expected_exc
       $this->expectExceptionMessage($expected_message);
     }
     $container = $this->mockModuleInVfs('ckeditor5_invalid_plugin', $yaml, $additional_files);
-    $container->get('plugin.manager.ckeditor5.plugin')->getDefinitions();
+    $pluginManager = $container->get('plugin.manager.ckeditor5.plugin');
+    $this->assertNotNull($pluginManager);
+    $this->assertIsArray($pluginManager->getDefinitions());
   }
 
   /**
diff --git a/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php b/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php
index bd1e4b940f9075451322b99bfd65d67f9ac8ba87..4c4bf6fda2f9014206a0cc934ba459c339edc5e2 100644
--- a/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php
+++ b/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php
@@ -24,7 +24,8 @@ public function testConstructor(array $elements, ?string $expected_exception_mes
       $this->expectException(\InvalidArgumentException::class);
       $this->expectExceptionMessage($expected_exception_message);
     }
-    new HTMLRestrictions($elements);
+    $restrictions = new HTMLRestrictions($elements);
+    $this->assertIsArray($restrictions->getAllowedElements(FALSE));
   }
 
   public static function providerConstruct(): \Generator {
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
index 5ec777cbc7dac76f61bdf0d9c570636bbcb6d649..cdd0b7a02307b63e9905ac7c86c9b4d40c3e4993 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
@@ -121,6 +121,7 @@ public function testMinimumVersion($success, $minimum_version, $schema_version):
     $this->databaseContents['system'][0]['schema_version'] = $schema_version;
     $plugin = new TestDrupalSqlBase([], 'test', $this->pluginDefinition, $this->getMigration(), $this->state, $this->entityTypeManager);
     $plugin->setDatabase($this->getDatabase($this->databaseContents));
+    $this->assertSame([], $plugin->fields());
 
     if (!$success) {
       $this->expectException(RequirementsException::class);
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/SchemaTest.php b/core/modules/mysql/tests/src/Kernel/mysql/SchemaTest.php
index 7e6e7fcb588231d808dda38e39133ce8d9df644a..19aaaf1cafe177cd8c776b21d2f00ec7ed9ca2cf 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/SchemaTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/SchemaTest.php
@@ -340,6 +340,7 @@ public function testGeneratedInvisiblePrimaryKey(): void {
       'type' => 'serial',
       'not null' => TRUE,
     ], ['primary key' => ['id']]);
+    $this->assertTrue($this->schema->fieldExists('test_primary_key', 'id'));
   }
 
 }
diff --git a/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php b/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
index 9b4ad1f5f0e4042723753fcb17408c73d2ff5613..2b00f79b84102153550161303212304390a3ff38 100644
--- a/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
+++ b/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
@@ -381,6 +381,7 @@ public function testUnsignedField(): void {
       'primary key' => ['order'],
     ];
     $this->schema->createTable($table_name, $table_spec);
+    $this->assertTrue($this->schema->tableExists($table_name));
   }
 
 }
diff --git a/core/phpunit.xml.dist b/core/phpunit.xml.dist
index 851579d320c2ddcc540fbd60aa27f8757370e824..8ba3241ec2b74bc0b37e47f446de7c691dffa6b7 100644
--- a/core/phpunit.xml.dist
+++ b/core/phpunit.xml.dist
@@ -11,6 +11,7 @@
          beStrictAboutTestsThatDoNotTestAnything="true"
          beStrictAboutOutputDuringTests="true"
          beStrictAboutChangesToGlobalState="true"
+         failOnRisky="true"
          failOnWarning="true"
          displayDetailsOnTestsThatTriggerErrors="true"
          displayDetailsOnTestsThatTriggerWarnings="true"
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php
index 2443817c8d2f8051b798d1fa835b95ce06639913..9f9e743050bea2233c693920896a1a6bf938ad4b 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php
@@ -11,7 +11,6 @@
 use Drupal\Tests\Core\DependencyInjection\Fixture\FinalTestNonTerminableHttpMiddlewareClass;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\Definition;
-use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 use Symfony\Component\HttpKernel\HttpKernel;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
 
@@ -144,12 +143,7 @@ public function testProcessWithStackedKernelAndFinalHttpMiddleware(): void {
         'responder' => TRUE,
       ]));
     $this->stackedKernelPass->process($this->containerBuilder);
-    try {
-      $this->containerBuilder->get('http_kernel');
-    }
-    catch (InvalidArgumentException $e) {
-      $this->fail($e->getMessage());
-    }
+    $this->assertIsObject($this->containerBuilder->get('http_kernel'));
   }
 
   /**