Skip to content
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

[CI] Fix randomly failed tests on Windows #74

Closed
wants to merge 2 commits into from
Closed
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: 10 additions & 1 deletion tests/TailwindBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use PHPUnit\Framework\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfonycasts\TailwindBundle\TailwindBuilder;
Expand All @@ -21,7 +22,15 @@ protected function setUp(): void
{
$fs = new Filesystem();
if (file_exists(__DIR__.'/fixtures/var/tailwind')) {
$fs->remove(__DIR__.'/fixtures/var/tailwind');
try {
$fs->remove(__DIR__.'/fixtures/var/tailwind');
} catch (IOException $e) {
// Sometimes "Permission denied" error happens on Windows,
// add a warning about it and try again in a second
$this->addWarning('Could not remove the temporary tailwind/ dir from the time: '.$e->getMessage());
sleep(1);
$fs->remove(__DIR__.'/fixtures/var/tailwind');
}
}
$fs->mkdir(__DIR__.'/fixtures/var/tailwind');
}
Expand Down
Loading