Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297680

Assert all expected values of in PerformanceTestTrait::assertMetrics at once

$
0
0

Problem/Motivation

Frequently, multiple things change at once in the performance metrics and the tests are very slow, so it is very time consuming to fix them.

Steps to reproduce

Build a single array of values, minus the bits we assert by range, then assert that at once.

Before:

1) Drupal\Tests\navigation\FunctionalJavascript\PerformanceTest::testLogin
Asserting CacheGetCount
Failed asserting that 64 is identical to 61.

/var/www/html/core/tests/Drupal/Tests/PerformanceTestTrait.php:672
/var/www/html/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php:101

After:

Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 [
     'QueryCount' => 4,
-    'CacheGetCount' => 61,
+    'CacheGetCount' => 64,
     'CacheGetCountByBin' => Array &1 [
         'config' => 10,
-        'data' => 6,
+        'data' => 9,
         'access_policy' => 1,
         'bootstrap' => 6,
         'dynamic_page_cache' => 2,
@@ @@
     ],
     'CacheDeleteCount' => 0,
     'CacheTagChecksumCount' => 3,
-    'CacheTagIsValidCount' => 31,
+    'CacheTagIsValidCount' => 34,
     'CacheTagInvalidationCount' => 0,
     'ScriptCount' => 2,
     'StylesheetCount' => 1,
 ]

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 297680

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>