diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 6df246c..39259b7 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -51,6 +51,16 @@ protected $curlHandle; /** + * Whether the test performed any HTTP request. + * + * @see \Drupal\simpletest\WebTestBase::curlExec() + * @see \Drupal\simpletest\WebTestBase::tearDown() + * + * @var bool + */ + private $testPerformedRequest = FALSE; + + /** * The headers of the page currently loaded in the internal browser. * * @var Array @@ -1117,6 +1127,9 @@ protected function refreshVariables() { * created by setUp(), and resets the database prefix. */ protected function tearDown() { + if (!$this->testPerformedRequest) { + $this->fail('This test did not perform a single HTTP request. Use DrupalUnitTestBase instead.'); + } // Destroy the testing kernel. if (isset($this->kernel)) { $this->kernel->shutdown(); @@ -1203,6 +1216,7 @@ protected function curlInitialize() { * @see curlInitialize() */ protected function curlExec($curl_options, $redirect = FALSE) { + $this->testPerformedRequest = TRUE; $this->curlInitialize(); if (!empty($curl_options[CURLOPT_URL])) { diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 77c058a..5a0d9c3 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -721,7 +721,7 @@ function simpletest_script_run_one_test($test_id, $test_class) { $test->run(); $duration = microtime(TRUE) - $start; - $max_duration = 120; + $max_duration = 3 * 60; $message = "Test duration: " . format_interval($duration) . ' (max allowed: ' . format_interval($max_duration) . ').'; TestBase::insertAssert($test_id, $test_class, $duration <= $max_duration, $message, 'Performance', array(