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

Conversation

bocharsky-bw
Copy link
Member

Sometimes we have random test failures on Windows, see https://github.com/SymfonyCasts/tailwind-bundle/actions/runs/11490280966/job/31980693499

1) Symfonycasts\TailwindBundle\Tests\TailwindBuilderTest::testBuildProvidedInputFile
Symfony\Component\Filesystem\Exception\IOException: Failed to remove file "D:\a\tailwind-bundle\tailwind-bundle\tests/fixtures/var/tailwind\v3.4.14\tailwindcss-windows-x64.exe": unlink(D:\a\tailwind-bundle\tailwind-bundle\tests/fixtures/var/tailwind\v3.4.14\tailwindcss-windows-x64.exe): Permission denied

D:\a\tailwind-bundle\tailwind-bundle\vendor\symfony\filesystem\Filesystem.php:202
D:\a\tailwind-bundle\tailwind-bundle\vendor\symfony\filesystem\Filesystem.php:190
D:\a\tailwind-bundle\tailwind-bundle\vendor\symfony\filesystem\Filesystem.php:190
D:\a\tailwind-bundle\tailwind-bundle\vendor\symfony\filesystem\Filesystem.php:158
D:\a\tailwind-bundle\tailwind-bundle\tests\TailwindBuilderTest.php:24
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestResult.php:[72](https://github.com/SymfonyCasts/tailwind-bundle/actions/runs/11490280966/job/31980693499#step:5:73)8
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestSuite.php:684
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestSuite.php:684
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestSuite.php:684
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:653

Probably this will help? Thoughts?

I think this may help

@bocharsky-bw
Copy link
Member Author

Well, seems it helped, see the prove in https://github.com/SymfonyCasts/tailwind-bundle/actions/runs/11500343719/job/32010355575?pr=74

1) Symfonycasts\TailwindBundle\Tests\TailwindBuilderTest::testBuildProvidedInputFile
Could not remove the temporary tailwind/ dir from the time: Failed to remove file "D:\a\tailwind-bundle\tailwind-bundle\tests/fixtures/var/tailwind\v3.4.14\tailwindcss-windows-x64.exe": unlink(D:\a\tailwind-bundle\tailwind-bundle\tests/fixtures/var/tailwind\v3.4.14\tailwindcss-windows-x64.exe): Permission denied

D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestResult.php:728
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestSuite.php:684
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestSuite.php:684
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\Framework\TestSuite.php:684
D:\a\tailwind-bundle\tailwind-bundle\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:653

WARNINGS!
Tests: 7, Assertions: 19, Warnings: 1.

@MolloKhan what do you think?

@MolloKhan
Copy link

If the file paths with mixed slashes / \ are not the issue, I'd try to remove the tailwind folder in the teardown method instead of setup(), so everything will happen during the same test. I mean, the folder will be created and deleted during the lifecycle of each test. That may help with permissions but I'm guessing

@bocharsky-bw
Copy link
Member Author

@MolloKhan I created a competitor PR for that in #75, let's see

@bocharsky-bw
Copy link
Member Author

Close in favor of #75

@bocharsky-bw bocharsky-bw deleted the fix-windows branch October 30, 2024 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants