Skip to content

Commit 03f3a68

Browse files
authored
Merge pull request #5095 from magento-performance/MC-23411
[Performance] Random failure of PAT builds
2 parents f540160 + 0562723 commit 03f3a68

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

setup/src/Magento/Setup/Fixtures/_files/dictionary.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7370,4 +7370,4 @@ Gregory
73707370
pine
73717371
borrowed
73727372
bow
7373-
disturbing
7373+
disturbing

setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AddressDataGenerator
1818
public function generateAddress()
1919
{
2020
return [
21-
'postcode' => random_int(10000, 99999)
21+
'postcode' => mt_rand(10000, 99999)
2222
];
2323
}
2424
}

setup/src/Magento/Setup/Model/DataGenerator.php

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

7-
/**
8-
* A custom adapter that allows generating arbitrary descriptions
9-
*/
107
namespace Magento\Setup\Model;
118

9+
/**
10+
* A custom adapter that allows generating arbitrary descriptions.
11+
*/
1212
class DataGenerator
1313
{
1414
/**
@@ -67,12 +67,12 @@ protected function readData()
6767
*/
6868
public function generate($minAmountOfWords, $maxAmountOfWords, $key = null)
6969
{
70-
$numberOfWords = random_int($minAmountOfWords, $maxAmountOfWords);
70+
$numberOfWords = mt_rand($minAmountOfWords, $maxAmountOfWords);
7171
$result = '';
7272

7373
if ($key === null || !array_key_exists($key, $this->generatedValues)) {
7474
for ($i = 0; $i < $numberOfWords; $i++) {
75-
$result .= ' ' . $this->dictionaryData[random_int(0, count($this->dictionaryData) - 1)];
75+
$result .= ' ' . $this->dictionaryData[mt_rand(0, count($this->dictionaryData) - 1)];
7676
}
7777
$result = trim($result);
7878

setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function generate()
6363
*/
6464
private function generateRawDescription()
6565
{
66-
$paragraphsCount = random_int(
66+
$paragraphsCount = mt_rand(
6767
$this->descriptionConfig['paragraphs']['count-min'],
6868
$this->descriptionConfig['paragraphs']['count-max']
6969
);

setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
*/
4040
public function generate()
4141
{
42-
$sentencesCount = random_int(
42+
$sentencesCount = mt_rand(
4343
$this->paragraphConfig['sentences']['count-min'],
4444
$this->paragraphConfig['sentences']['count-max']
4545
);

setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
*/
4040
public function generate()
4141
{
42-
$sentenceWordsCount = random_int(
42+
$sentenceWordsCount = mt_rand(
4343
$this->sentenceConfig['words']['count-min'],
4444
$this->sentenceConfig['words']['count-max']
4545
);

setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function apply($text)
4848

4949
return $this->wordWrapper->wrapWords(
5050
$text,
51-
$this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)),
51+
$this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)),
5252
'<b>%s</b>'
5353
);
5454
}

setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getRandomWords($source, $count)
2727
$randWords = [];
2828
$wordsSize = count($words);
2929
while ($count) {
30-
$randWords[] = $words[random_int(0, $wordsSize - 1)];
30+
$randWords[] = $words[mt_rand(0, $wordsSize - 1)];
3131
$count--;
3232
}
3333

setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function apply($text)
4848

4949
return $this->wordWrapper->wrapWords(
5050
$text,
51-
$this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)),
51+
$this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)),
5252
'<i>%s</i>'
5353
);
5454
}

setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function apply($text)
4848

4949
return $this->wordWrapper->wrapWords(
5050
$text,
51-
$this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)),
51+
$this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)),
5252
'<span>%s</span>'
5353
);
5454
}

0 commit comments

Comments
 (0)