Skip to content

Fix flaky test #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/Integration/OutputNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,26 @@ public static function removeIntermediateNonFixedProgressBars(
$itemsCount,
);

// Remove intermediate lines
$output = preg_replace(
'#\s+\d+ \[[->]+?\] .+?MiB\\n#',
'',
$output,
);

$output = preg_replace(
'#\s+\d+ \[[->]+?\] .+?MiB#',
'',
$output,
);

return $restoreFirstLine($restoreLastLine($output));
$output = $restoreFirstLine($restoreLastLine($output));

// Normalize last line
return preg_replace(
'#(\s+'.$itemsCount.' )\[[->]+?\]( .+?MiB)#',
'$1[----->----------------------]$2',
$output,
);
}

/**
Expand Down
23 changes: 20 additions & 3 deletions tests/Integration/OutputNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public static function nonFixedSizedProgressBarsProvider(): iterable
<<<'TXT'

0 [>---------------------------] < 1 sec 8.0 MiB
12 [----------------------------] 142 secs 112.0 MiB
12 [----->----------------------] 142 secs 112.0 MiB

TXT,
];
Expand All @@ -363,7 +363,7 @@ public static function nonFixedSizedProgressBarsProvider(): iterable
<<<'TXT'

0 [>---------------------------] < 1 sec 8.0 MiB
12 [>---------------------------] 142 secs 112.0 MiB
12 [----->----------------------] 142 secs 112.0 MiB

TXT,
];
Expand All @@ -383,7 +383,7 @@ public static function nonFixedSizedProgressBarsProvider(): iterable
<<<'TXT'

0 [>---------------------------] < 1 sec 8.0 MiB
12 [------------>---------------] 142 secs 112.0 MiB
12 [----->----------------------] 142 secs 112.0 MiB

TXT,
];
Expand All @@ -405,6 +405,23 @@ public static function nonFixedSizedProgressBarsProvider(): iterable

TXT,
];

// https://github.com/webmozarts/console-parallelization/actions/runs/3418534317/jobs/5690951308
yield 'final step at a random stage' => [
<<<'TXT'

0 [>---------------------------] 10 secs 10.0 MiB
5 [------->--------------------] 10 secs 10.0 MiB

TXT,
5,
<<<'TXT'

0 [>---------------------------] 10 secs 10.0 MiB
5 [----->----------------------] 10 secs 10.0 MiB

TXT,
];
}

/**
Expand Down