[MGNLCE-296] Improve the filter so it allows to resolve an item by key Created: 21/Mar/22  Updated: 27/Oct/22

Status: Selected
Project: Community Edition
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Maxime Michel Assignee: Michael Duerig
Resolution: Unresolved Votes: 0
Labels: foundation_team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to MGNLEE-688 Ignore test when cache monitor return... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Team: Foundation

 Description   

it.info.magnolia.integrationtests.cache.CacheTest#cacheableItem started to randomly fail with the following:

java.lang.AssertionError: 

Expected: a string containing "behaviour=useCache"
     but: was "CachePolicyResult{behaviour=store, cacheName=defaultPageCache, cacheKey=DefaultCacheKey{uri='/.resources/defaultMagnoliaLoginForm/img/favicon.ico', serverName='172.17.0.1', locale='en', channel='all', params={}', secure='false', method='get', additionalAttributes='{}'}, cachedEntry=info.magnolia.module.cache.filter.InMemoryCachedEntry@320cd616[gzippedContent=2087 bytes,plainContent=4406 bytes,characterEncoding=UTF-8,contentType=image/x-icon,lastModificationTime=1647586860000,originalUrl=http://172.17.0.1:8080/magnoliaPublic/.resources/defaultMagnoliaLoginForm/img/favicon.ico,serializableHeadersBackingList={Last-Modified=[1647586860000], Content-Type=[image/x-icon]},statusCode=200,timeToLiveInSeconds=-1]}" 

It looks like a concurrent request that has nothing to do with the test gets in the way. Hence, the suggestion would be to improve info.magnolia.test.fixture.CacheMonitorFilter and allow it to take a key as parameter for a file, and to be able to verify the status for an object according to the key.

Implementation note

As a workaround we ignore/skip the test for now when the cache results returned by the CacheMonitorFilter belongs to a different request. See https://git.magnolia-cms.com/projects/PLATFORM/repos/ce/commits/662ce75be4e9194a39198dc33903d5f0cfdf2d8e

 



 Comments   
Comment by Michael Duerig [ 25/Mar/22 ]

See MGNLEE-688 for some similar cases in dx-core.

Generated at Mon Feb 12 00:08:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.