diff --git a/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php index 6e4f82d..c6fbdd0 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php @@ -79,7 +79,6 @@ public function onResponse(FilterResponseEvent $event) { $response->headers->add([ 'X-Drupal-Memory-Peak' => round($memory_usage / 1024 / 1024, 2), ]); - $event->setResponse($response); } } diff --git a/core/modules/simpletest/src/Tests/BrokenSetUpTest.php b/core/modules/simpletest/src/Tests/BrokenSetUpTest.php index dae351b..4067f79 100644 --- a/core/modules/simpletest/src/Tests/BrokenSetUpTest.php +++ b/core/modules/simpletest/src/Tests/BrokenSetUpTest.php @@ -32,7 +32,7 @@ class BrokenSetUpTest extends WebTestBase { /** * The memory limit for this test, Testing module requires 128M. */ - protected $memoryUsageTrigger = 128; + protected $memoryUsageTrigger = 140; /** * The path to the shared trigger file. diff --git a/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php b/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php index 4cca66a..a58d378 100644 --- a/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php +++ b/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php @@ -33,7 +33,7 @@ class InstallationProfileModuleTestsTest extends WebTestBase { /** * The memory limit for this test, Testing module requires 128M. */ - protected $memoryUsageTrigger = 128; + protected $memoryUsageTrigger = 140; /** * Use the Testing profile. diff --git a/core/modules/simpletest/src/Tests/MissingCheckedRequirementsTest.php b/core/modules/simpletest/src/Tests/MissingCheckedRequirementsTest.php index 667181e..5f95148 100644 --- a/core/modules/simpletest/src/Tests/MissingCheckedRequirementsTest.php +++ b/core/modules/simpletest/src/Tests/MissingCheckedRequirementsTest.php @@ -26,7 +26,7 @@ class MissingCheckedRequirementsTest extends WebTestBase { /** * The memory limit for this test, Testing module requires 128M. */ - protected $memoryUsageTrigger = 128; + protected $memoryUsageTrigger = 140; protected function setUp() { parent::setUp(); diff --git a/core/modules/simpletest/src/Tests/OtherInstallationProfileTestsTest.php b/core/modules/simpletest/src/Tests/OtherInstallationProfileTestsTest.php index 74ce9f2..d7be9ab 100644 --- a/core/modules/simpletest/src/Tests/OtherInstallationProfileTestsTest.php +++ b/core/modules/simpletest/src/Tests/OtherInstallationProfileTestsTest.php @@ -41,7 +41,7 @@ class OtherInstallationProfileTestsTest extends WebTestBase { /** * The memory limit for this test, Testing module requires 128M. */ - protected $memoryUsageTrigger = 128; + protected $memoryUsageTrigger = 140; /** * An administrative user with permission to administer unit tests. diff --git a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php index cfd7bc4..94aefa2 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php @@ -27,7 +27,7 @@ class SimpleTestBrowserTest extends WebTestBase { /** * The memory limit for this test, Testing module requires 128M. */ - protected $memoryUsageTrigger = 128; + protected $memoryUsageTrigger = 140; public function setUp() { parent::setUp(); diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index fc4e865..85b8187 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -29,7 +29,7 @@ class SimpleTestTest extends WebTestBase { /** * The memory limit for this test, Testing module requires 128M. */ - protected $memoryUsageTrigger = 128; + protected $memoryUsageTrigger = 140; /** * The results array that has been parsed by getTestResults(). @@ -217,6 +217,13 @@ function stubTest() { // This causes the debug message asserted in confirmStubResults(). debug('Foo', 'Debug', FALSE); + + // This causes \Drupal\simpletest\WebTestBase::curlHeaderCallback() to fail. + // Set an absurdly low limit and get a page. + $old_limit = $this->memoryUsageTrigger; + $this->memoryUsageTrigger = 1; + $this->drupalGet($user->url()); + $this->memoryUsageTrigger = $old_limit; } /** @@ -255,7 +262,9 @@ function confirmStubTestResults() { $this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()'); - $this->assertEqual('15 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']); + $this->assertAssertion("exceeded acceptable maximum (1MB)", 'Other', 'Fail', 'WebTestBase.php', 'Drupal\simpletest\WebTestBase->curlExec()'); + + $this->assertEqual('17 passes, 4 fails, 2 exceptions, 4 debug messages', $this->childTestResults['summary']); $this->testIds[] = $test_id = $this->getTestIdFromResults(); $this->assertTrue($test_id, 'Found test ID in results.');