Skip to content
Snippets Groups Projects
Commit 361bb945 authored by catch's avatar catch
Browse files

Merge branch '3463351-consolidate-methods-in' into '11.x'

Issue #3463351: consolidate OpenTelemetryNodePagePerformanceTest methods.

See merge request !8890
parents d9a1ec2d dab72495
No related branches found
No related tags found
No related merge requests found
Pipeline #232205 failed
Pipeline: drupal

#232207

    ......@@ -20,10 +20,23 @@ class OpenTelemetryNodePagePerformanceTest extends PerformanceTestBase {
    */
    protected $profile = 'demo_umami';
    /**
    * Test canonical node page performance with various cache permutations.
    */
    public function testNodePage(): void {
    $this->testNodePageColdCache();
    sleep(1);
    $this->testNodePageCoolCache();
    sleep(1);
    $this->testNodePageWarmCache();
    sleep(1);
    $this->testNodePageHotCache();
    }
    /**
    * Logs node page tracing data with a cold cache.
    */
    public function testNodePageColdCache(): void {
    protected function testNodePageColdCache(): void {
    // @todo Chromedriver doesn't collect tracing performance logs for the very
    // first request in a test, so warm it up.
    // https://www.drupal.org/project/drupal/issues/3379750
    ......@@ -40,7 +53,7 @@ public function testNodePageColdCache(): void {
    *
    * Hot here means that all possible caches are warmed.
    */
    public function testNodePageHotCache(): void {
    protected function testNodePageHotCache(): void {
    // Request the page twice so that asset aggregates are definitely cached in
    // the browser cache.
    $this->drupalGet('node/1');
    ......@@ -64,7 +77,7 @@ public function testNodePageHotCache(): void {
    * Cool here means that 'global' site caches are warm but anything
    * specific to the route or path is cold.
    */
    public function testNodePageCoolCache(): void {
    protected function testNodePageCoolCache(): void {
    // First of all visit the node page to ensure the image style exists.
    $this->drupalGet('node/1');
    $this->rebuildAll();
    ......@@ -82,7 +95,7 @@ public function testNodePageCoolCache(): void {
    * Warm here means that 'global' site caches and route-specific caches are
    * warm but caches specific to this particular node/path are not.
    */
    public function testNodePageWarmCache(): void {
    protected function testNodePageWarmCache(): void {
    // First of all visit the node page to ensure the image style exists.
    $this->drupalGet('node/1');
    $this->rebuildAll();
    ......
    ......@@ -103,6 +103,7 @@ public function collectPerformanceData(callable $callable, ?string $service_name
    // no performance data logged by the child request within one second, that
    // this means everything has finished.
    $collection = \Drupal::keyValue('performance_test');
    sleep(1);
    while ($collection->get('performance_test_data')) {
    $collection->deleteAll();
    sleep(1);
    ......@@ -110,7 +111,6 @@ public function collectPerformanceData(callable $callable, ?string $service_name
    $session = $this->getSession();
    $session->getDriver()->getWebDriverSession()->log('performance');
    $collection = \Drupal::keyValue('performance_test');
    $collection->deleteAll();
    $return = $callable();
    $performance_data = $this->processChromeDriverPerformanceLogs($service_name);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment