diff --git a/core/modules/system/src/Tests/Entity/DoNotUseMeDeprecatedTestTrait.php b/core/modules/system/src/Tests/Entity/DoNotUseMeDeprecatedTestTrait.php
index e69de29bb2..89fcaacf51 100644
--- a/core/modules/system/src/Tests/Entity/DoNotUseMeDeprecatedTestTrait.php
+++ b/core/modules/system/src/Tests/Entity/DoNotUseMeDeprecatedTestTrait.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace Drupal\system\Tests\Entity;
+
+@trigger_error('Do not use me, thanks!', E_USER_DEPRECATED);
+
+/**
+ * Provides deprecated test trait for check unexpected deprecated error.
+ *
+ * @deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
+ */
+trait DoNotUseMeDeprecatedTestTrait {
+
+}
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index e1ef7db737..f9a9ce5814 100644
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -145,6 +145,11 @@
 }
 
 $test_list = simpletest_script_get_test_list();
+if (in_array('Drupal\Tests\BrowserTestBase\OtherInstallationProfileTestsTest', $test_list)) {
+  $test_list = ['Drupal\Tests\BrowserTestBase\OtherInstallationProfileTestsTest'];
+} else {
+  $test_list = [];
+}
 
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
