Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,7 @@ public function testFrontPageCoolCache() { ...@@ -80,7 +80,7 @@ public function testFrontPageCoolCache() {
$this->drupalGet('<front>'); $this->drupalGet('<front>');
$this->rebuildAll(); $this->rebuildAll();
// Now visit a different page to warm non-route-specific caches. // Now visit a different page to warm non-route-specific caches.
$this->drupalGet('/user/login'); $this->drupalGet('user/login');
$this->collectPerformanceData(function () { $this->collectPerformanceData(function () {
$this->drupalGet('<front>'); $this->drupalGet('<front>');
}, 'umamiFrontPageCoolCache'); }, 'umamiFrontPageCoolCache');
......
...@@ -29,7 +29,7 @@ public function testNodePageColdCache() { ...@@ -29,7 +29,7 @@ public function testNodePageColdCache() {
$this->drupalGet('user/login'); $this->drupalGet('user/login');
$this->rebuildAll(); $this->rebuildAll();
$this->collectPerformanceData(function () { $this->collectPerformanceData(function () {
$this->drupalGet('/node/1'); $this->drupalGet('node/1');
}, 'umamiNodePageColdCache'); }, 'umamiNodePageColdCache');
$this->assertSession()->pageTextContains('quiche'); $this->assertSession()->pageTextContains('quiche');
} }
...@@ -44,10 +44,17 @@ public function testNodePageHotCache() { ...@@ -44,10 +44,17 @@ public function testNodePageHotCache() {
// the browser cache. // the browser cache.
$this->drupalGet('node/1'); $this->drupalGet('node/1');
$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'); }, 'umamiNodePageHotCache');
$this->assertSession()->pageTextContains('quiche'); $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() { ...@@ -61,9 +68,9 @@ public function testNodePageCoolCache() {
$this->drupalGet('node/1'); $this->drupalGet('node/1');
$this->rebuildAll(); $this->rebuildAll();
// Now visit a non-node page to warm non-route-specific caches. // Now visit a non-node page to warm non-route-specific caches.
$this->drupalGet('/user/login'); $this->drupalGet('user/login');
$this->collectPerformanceData(function () { $this->collectPerformanceData(function () {
$this->drupalGet('/node/1'); $this->drupalGet('node/1');
}, 'umamiNodePageCoolCache'); }, 'umamiNodePageCoolCache');
$this->assertSession()->pageTextContains('quiche'); $this->assertSession()->pageTextContains('quiche');
} }
...@@ -79,9 +86,9 @@ public function testNodePageWarmCache() { ...@@ -79,9 +86,9 @@ public function testNodePageWarmCache() {
$this->drupalGet('node/1'); $this->drupalGet('node/1');
$this->rebuildAll(); $this->rebuildAll();
// Now visit a different node page to warm non-path-specific caches. // Now visit a different node page to warm non-path-specific caches.
$this->drupalGet('/node/2'); $this->drupalGet('node/2');
$this->collectPerformanceData(function () { $this->collectPerformanceData(function () {
$this->drupalGet('/node/1'); $this->drupalGet('node/1');
}, 'umamiNodePageWarmCache'); }, 'umamiNodePageWarmCache');
$this->assertSession()->pageTextContains('quiche'); $this->assertSession()->pageTextContains('quiche');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment