Skip to content
Snippets Groups Projects
Commit dc7866bf authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3530523 follow-up by catch: Update assertions and make caches as warm...

Issue #3530523 follow-up by catch: Update assertions and make caches as warm as possible to prevent performance test failures
parent 1a4d3a9a
Branches
Tags
No related merge requests found
Pipeline #525444 passed
......@@ -75,10 +75,12 @@ class PerformanceTest extends PerformanceTestBase {
$editor = $this->drupalCreateUser();
$editor->addRole('content_editor')->save();
$this->drupalLogin($editor);
// Warm various caches. Drupal CMS redirects the front page to /home, so
// visit that directly.
// Warm various caches.
$this->drupalGet('');
// Allow one second for post response tasks to write caches.
sleep(1);
$this->drupalGet('');
sleep(1);
// Test frontpage.
$performance_data = $this->collectPerformanceData(function () {
......@@ -110,16 +112,16 @@ class PerformanceTest extends PerformanceTestBase {
$expected = [
'QueryCount' => 9,
'CacheGetCount' => 81,
'CacheGetCount' => 70,
'CacheSetCount' => 0,
'CacheTagLookupQueryCount' => 8,
'CacheTagLookupQueryCount' => 9,
// If there are small changes in the below limits, e.g. under 5kb, the
// ceiling can be raised without any investigation. However large increases
// indicate a large library is newly loaded for authenticated users.
'StylesheetCount' => 3,
'StylesheetBytes' => 297500,
'StylesheetBytes' => 218000,
'ScriptCount' => 4,
'ScriptBytes' => 318000,
'ScriptBytes' => 244800,
];
$this->assertMetrics($expected, $performance_data);
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment