Skip to content

Commit e767697

Browse files
Yaroslav Onischenkoxmav
authored andcommitted
MAGETWO-66343: [Performance] Anomaly increase in redis traffic
1 parent eeae939 commit e767697

File tree

2 files changed

+17
-55
lines changed

2 files changed

+17
-55
lines changed

dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple.php

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,16 @@
1212
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
1313

1414
/** @var \Magento\Catalog\Api\CategoryLinkManagementInterface $categoryLinkManagement */
15-
$categoryLinkManagement = $objectManager->create(\Magento\Catalog\Api\CategoryLinkManagementInterface::class);
15+
$categoryLinkManagement = $objectManager->get(\Magento\Catalog\Api\CategoryLinkManagementInterface::class);
1616

1717
$tierPrices = [];
1818
/** @var \Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory $tierPriceFactory */
1919
$tierPriceFactory = $objectManager->get(\Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory::class);
20-
$tierPrices[] = $tierPriceFactory->create(
21-
[
22-
'data' => [
23-
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
24-
'qty' => 2,
25-
'value' => 8
26-
]
27-
]
28-
);
29-
$tierPrices[] = $tierPriceFactory->create(
30-
[
31-
'data' => [
32-
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
33-
'qty' => 5,
34-
'value' => 5
35-
]
36-
]
37-
);
38-
$tierPrices[] = $tierPriceFactory->create(
39-
[
40-
'data' => [
41-
'customer_group_id' => \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID,
42-
'qty' => 3,
43-
'value' => 5
44-
]
45-
]
46-
);
4720
/** @var $tpExtensionAttributes */
48-
$tpExtensionAttributesFactory = $objectManager->create(ProductTierPriceExtensionFactory::class);
49-
$tpExtensionAttributes = $tpExtensionAttributesFactory->create()->setPercentageValue(50);
21+
$tpExtensionAttributesFactory = $objectManager->get(ProductTierPriceExtensionFactory::class);
5022

51-
$tierPrices[] = $tierPriceFactory->create(
52-
[
53-
'data' => [
54-
'customer_group_id' => \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID,
55-
'qty' => 10
56-
]
57-
]
58-
)->setExtensionAttributes($tpExtensionAttributes);
59-
60-
$tierPrices = [];
61-
/** @var \Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory $tierPriceFactory */
62-
$tierPriceFactory = $objectManager->get(\Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory::class);
23+
$adminWebsite = $objectManager->get(\Magento\Store\Api\WebsiteRepositoryInterface::class)->get('admin');
24+
$tierPriceWebsiteId = $tpExtensionAttributesFactory->create()->setWebsiteId($adminWebsite->getId());
6325
$tierPrices[] = $tierPriceFactory->create(
6426
[
6527
'data' => [
@@ -68,7 +30,7 @@
6830
'value' => 8
6931
]
7032
]
71-
);
33+
)->setExtensionAttributes($tierPriceWebsiteId);
7234
$tierPrices[] = $tierPriceFactory->create(
7335
[
7436
'data' => [
@@ -77,7 +39,7 @@
7739
'value' => 5
7840
]
7941
]
80-
);
42+
)->setExtensionAttributes($tierPriceWebsiteId);
8143
$tierPrices[] = $tierPriceFactory->create(
8244
[
8345
'data' => [
@@ -86,10 +48,11 @@
8648
'value' => 5
8749
]
8850
]
89-
);
90-
/** @var $tpExtensionAttributes */
91-
$tpExtensionAttributesFactory = $objectManager->create(ProductTierPriceExtensionFactory::class);
92-
$tpExtensionAttributes = $tpExtensionAttributesFactory->create()->setPercentageValue(50);
51+
)->setExtensionAttributes($tierPriceWebsiteId);
52+
53+
$tierPricePercentageValue = $tpExtensionAttributesFactory->create()
54+
->setPercentageValue(50)
55+
->setWebsiteId($adminWebsite->getId());
9356

9457
$tierPrices[] = $tierPriceFactory->create(
9558
[
@@ -98,7 +61,7 @@
9861
'qty' => 10
9962
]
10063
]
101-
)->setExtensionAttributes($tpExtensionAttributes);
64+
)->setExtensionAttributes($tierPricePercentageValue);
10265

10366
/** @var $product \Magento\Catalog\Model\Product */
10467
$product = $objectManager->create(\Magento\Catalog\Model\Product::class);

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
'default',
2828
0
2929
);
30-
/** @var \Magento\Framework\App\Config\ReinitableConfigInterface $reinitiableConfig */
31-
$reinitiableConfig = $objectManager->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class);
32-
$reinitiableConfig->setValue(
33-
'catalog/price/scope',
34-
\Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE
35-
);
30+
31+
/** @var Magento\Config\App\Config\Type\System $config */
32+
$config = $objectManager->get(\Magento\Config\App\Config\Type\System::class);
33+
$config->clean();
34+
3635
$observer = $objectManager->get(\Magento\Framework\Event\Observer::class);
3736
$objectManager->get(\Magento\Catalog\Observer\SwitchPriceAttributeScopeOnConfigChange::class)
3837
->execute($observer);

0 commit comments

Comments
 (0)