- π¬π§United Kingdom catch
Just rediscovered these tests and the 2-3 base classes. I think we could remove the page cache stuff, and make them kernel tests for a start?
While investigating #2914110 I came to the realization that EntityCacheTagsTestBase::testReferencedEntity() is very complicated and sort of breaks shortcuts ability to use the class for its test.
There is a lot going on in this test. Cache::mergeContexts for days but you don't really need to understand those if we look very closely at the code failing for shortcut.module to get to the root of the problem.
$this->verifyPageCache($referencing_entity_url, 'HIT', $expected_tags);
Two pieces of context, first $referencing_entity_url = $this->referencingEntity->toUrl('canonical');
Additional $this->referencingEntity
is a \Drupal\entity_test\Entity\EntityTest
that in setUp dynamically creates a reference and stores a reference the entity being tested. In this case a shortcut entity.
So now the assertion, verifyPageCache()
, makes a request to the canonical url and checks the cache tags on the full page render. It seems the logic being tested is that the tags from the reference entity are bubbled up as part of the entity and those should bubble all the way to the full page. Kinda ugly but you can sort of follow it.
The complexity of testing the _entire_ render process instead of just the entity cache tag reference logic directly is what's causing the problem though. By varying the cache tags through the page_title on every page we're changing the base cache tags for every page. That breaks this assertion(and dozens of later assertions) because the test can't handle that and assumes all pages will have the same base set of tags. Any interaction with that from a module breaks the test.
?
?
n/a
?
n/a
?
Active
11.0 π₯
It affects performance. It is often combined with the Needs profiling tag.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Just rediscovered these tests and the 2-3 base classes. I think we could remove the page cache stuff, and make them kernel tests for a start?