Skip to content

Commit 74527a0

Browse files
committed
ACP2E-1772: cataloginventory_stock partial Indexers processing slowly due to an issue in a query
1 parent 9758495 commit 74527a0

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $sto
122122
$this->selectMock->expects($this->any())
123123
->method('from')
124124
->willReturnSelf();
125-
$this->selectMock->expects($this->any())
126-
->method('where')
127-
->willReturnSelf();
128125
$this->selectMock->expects($this->any())
129126
->method('joinLeft')
130127
->willReturnSelf();
@@ -141,6 +138,21 @@ public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $sto
141138
['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter],
142139
]
143140
);
141+
$this->connectionMock->expects($this->exactly(3))
142+
->method('select')
143+
->willReturn($this->selectMock);
144+
$this->selectMock->expects($this->exactly(7))
145+
->method('where')
146+
->withConsecutive(
147+
['product_id IN (?)'],
148+
['stock_id = ?'],
149+
['website_id = ?'],
150+
['product_id IN (?)'],
151+
['stock_id = ?'],
152+
['website_id = ?'],
153+
['product_id IN (?)', [123], \Zend_Db::INT_TYPE]
154+
)
155+
->willReturnSelf();
144156
$this->connectionMock->expects($this->exactly(1))
145157
->method('fetchCol')
146158
->willReturn([$categoryId]);

0 commit comments

Comments
 (0)