Skip to content

Commit f289be7

Browse files
committed
Merge branch 'ACP2E-2372' of https://github.com/magento-l3/magento2ce into PR2-L3-09132023
2 parents c4a6274 + 8ce379d commit f289be7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

dev/tests/integration/framework/Magento/TestFramework/MessageQueue/PublisherConsumerController.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class PublisherConsumerController
5656
private $clearQueueProcessor;
5757

5858
/**
59-
* PublisherConsumerController constructor.
6059
* @param PublisherInterface $publisher
6160
* @param OsInfo $osInfo
6261
* @param Amqp $amqpHelper
@@ -70,18 +69,18 @@ public function __construct(
7069
PublisherInterface $publisher,
7170
OsInfo $osInfo,
7271
Amqp $amqpHelper,
73-
$logFilePath,
74-
$consumers,
75-
$appInitParams,
76-
$maxMessages = null,
72+
string $logFilePath = TESTS_TEMP_DIR . '/MessageQueueTestLog.txt',
73+
array $consumers = [],
74+
array $appInitParams = [],
75+
?int $maxMessages = null,
7776
ClearQueueProcessor $clearQueueProcessor = null
7877
) {
7978
$this->consumers = $consumers;
8079
$this->publisher = $publisher;
8180
$this->logFilePath = $logFilePath;
8281
$this->maxMessages = $maxMessages;
8382
$this->osInfo = $osInfo;
84-
$this->appInitParams = $appInitParams;
83+
$this->appInitParams = $appInitParams ?: Bootstrap::getInstance()->getAppInitParams();
8584
$this->amqpHelper = $amqpHelper;
8685
$this->clearQueueProcessor = $clearQueueProcessor
8786
?: Bootstrap::getObjectManager()->get(ClearQueueProcessor::class);
@@ -200,13 +199,13 @@ private function getConsumerStartCommand($consumer, $withEnvVariables = false)
200199
* @param array $params
201200
* @throws PreconditionFailedException
202201
*/
203-
public function waitForAsynchronousResult(callable $condition, $params)
202+
public function waitForAsynchronousResult(callable $condition, $params = [])
204203
{
205204
$i = 0;
206205
do {
207206
sleep(3);
208207
$assertion = call_user_func_array($condition, $params);
209-
} while (!$assertion && ($i++ < 10));
208+
} while (!$assertion && ($i++ < 20));
210209

211210
if (!$assertion) {
212211
throw new PreconditionFailedException("No asynchronous messages were processed.");

0 commit comments

Comments
 (0)