Skip to content

Commit 3a94121

Browse files
committed
ACPT-1572: Slow saving of stores/websites
- Clean cache in tests as previously saving websites, stores, & store views cleaned all cache by default;
1 parent 1e8d895 commit 3a94121

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

app/code/Magento/Customer/Model/Metadata/AttributeMetadataCache.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\App\CacheInterface;
1414
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1515
use Magento\Framework\Serialize\SerializerInterface;
16+
use Magento\Store\Model\Store;
1617
use Magento\Store\Model\StoreManagerInterface;
1718

1819
/**
@@ -138,7 +139,8 @@ public function save($entityType, array $attributes, $suffix = '')
138139
[
139140
Type::CACHE_TAG,
140141
Attribute::CACHE_TAG,
141-
System::CACHE_TAG
142+
System::CACHE_TAG,
143+
Store::CACHE_TAG
142144
]
143145
);
144146
}

dev/tests/integration/testsuite/Magento/Customer/Ui/Component/Listing/AttributeRepositoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Magento\Customer\Ui\Component\Listing;
99

1010
use Magento\TestFramework\Helper\Bootstrap;
11-
use Magento\TestFramework\Helper\CacheCleaner;
1211
use PHPUnit\Framework\TestCase;
1312

1413
/**
@@ -39,7 +38,6 @@ protected function setUp(): void
3938
*/
4039
public function testGetOptionArray(): void
4140
{
42-
CacheCleaner::clean(['config']);
4341
$result = $this->model->getMetadataByCode('store_id');
4442

4543
$this->assertTrue(isset($result['options']['1']['value']));

dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
use Magento\TestFramework\Helper\CacheCleaner;
8-
97
$website = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Website::class);
108
/** @var $website \Magento\Store\Model\Website */
119
if (!$website->load('test', 'code')->getId()) {
@@ -60,5 +58,3 @@
6058
$indexerRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
6159
->create(\Magento\Framework\Indexer\IndexerRegistry::class);
6260
$indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID)->reindexAll();
63-
64-
CacheCleaner::clean(['config']);

lib/internal/Magento/Framework/Model/AbstractModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ public function getCacheTags()
828828
public function cleanModelCache()
829829
{
830830
$tags = $this->getCacheTags();
831-
if ($tags !== false) {
831+
if (!empty($tags)) {
832832
$this->_cacheManager->clean($tags);
833833
}
834834
return $this;

0 commit comments

Comments
 (0)