Verified Commit 0bdb3091 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3412641 by catch, alexpott:...

Issue #3412641 by catch, alexpott: OpenTelemetryNodePagePerformanceTest::testNodePageHotCache() is not hot enough
parent 83a53ba4
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public function testFrontPageCoolCache() {
    $this->drupalGet('<front>');
    $this->rebuildAll();
    // Now visit a different page to warm non-route-specific caches.
    $this->drupalGet('/user/login');
    $this->drupalGet('user/login');
    $this->collectPerformanceData(function () {
      $this->drupalGet('<front>');
    }, 'umamiFrontPageCoolCache');
+14 −7
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public function testNodePageColdCache() {
    $this->drupalGet('user/login');
    $this->rebuildAll();
    $this->collectPerformanceData(function () {
      $this->drupalGet('/node/1');
      $this->drupalGet('node/1');
    }, 'umamiNodePageColdCache');
    $this->assertSession()->pageTextContains('quiche');
  }
@@ -44,10 +44,17 @@ public function testNodePageHotCache() {
    // the browser cache.
    $this->drupalGet('node/1');
    $this->drupalGet('node/1');
    $this->collectPerformanceData(function () {
      $this->drupalGet('/node/1');

    $performance_data = $this->collectPerformanceData(function () {
      $this->drupalGet('node/1');
    }, 'umamiNodePageHotCache');
    $this->assertSession()->pageTextContains('quiche');
    $this->assertSame($performance_data->getQueryCount(), 0);
    $this->assertSame($performance_data->getCacheGetCount(), 1);
    $this->assertSame($performance_data->getCacheSetCount(), 0);
    $this->assertSame($performance_data->getCacheDeleteCount(), 0);
    $this->assertSame(0, $performance_data->getCacheTagChecksumCount());
    $this->assertSame(1, $performance_data->getCacheTagIsValidCount());
  }

  /**
@@ -61,9 +68,9 @@ public function testNodePageCoolCache() {
    $this->drupalGet('node/1');
    $this->rebuildAll();
    // Now visit a non-node page to warm non-route-specific caches.
    $this->drupalGet('/user/login');
    $this->drupalGet('user/login');
    $this->collectPerformanceData(function () {
      $this->drupalGet('/node/1');
      $this->drupalGet('node/1');
    }, 'umamiNodePageCoolCache');
    $this->assertSession()->pageTextContains('quiche');
  }
@@ -79,9 +86,9 @@ public function testNodePageWarmCache() {
    $this->drupalGet('node/1');
    $this->rebuildAll();
    // Now visit a different node page to warm non-path-specific caches.
    $this->drupalGet('/node/2');
    $this->drupalGet('node/2');
    $this->collectPerformanceData(function () {
      $this->drupalGet('/node/1');
      $this->drupalGet('node/1');
    }, 'umamiNodePageWarmCache');
    $this->assertSession()->pageTextContains('quiche');
  }