Skip to content

Commit 8bc3f49

Browse files
authored
MDEE-881: Fix failed tests on php 8.3 (#465)
1 parent e49eb1e commit 8bc3f49

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ProductPriceDataExporter/Test/Integration/AbstractProductPriceTestHelper.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ protected function setUp(): void
8282
$this->reindexProductPriceDataExporter();
8383
}
8484

85+
/**
86+
* Wait one second before test execution after fixtures created.
87+
*
88+
* @return void
89+
*/
90+
protected function emulateCustomersBehaviorAfterDeleteAction(): void
91+
{
92+
// Avoid getFeed right after product was created.
93+
// We have to emulate real customers behavior
94+
// as it's possible that feed in test will be retrieved in same time as product created:
95+
// \Magento\DataExporter\Model\Query\RemovedEntitiesByModifiedAtQuery::getQuery
96+
sleep(1);
97+
}
98+
8599
/**
86100
* @param array $expectedItems
87101
* @return void

ProductPriceDataExporter/Test/Integration/ExportSingleProductPriceTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function testExportSimpleProductsWithDisabledCatalogPriceRulePrices(array
8383
$rule->setIsActive(0);
8484
$this->catalogRuleRepository->save($rule);
8585
$ruleProductProcessor->getIndexer()->reindexAll();
86+
$this->emulateCustomersBehaviorAfterDeleteAction();
8687
$this->checkExpectedItemsAreExportedInFeed($expectedSimpleProductPrices);
8788
}
8889

0 commit comments

Comments
 (0)