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

Finder test failure #27480

Closed
flip111 opened this issue Jun 3, 2018 · 5 comments
Closed

Finder test failure #27480

flip111 opened this issue Jun 3, 2018 · 5 comments

Comments

@flip111
Copy link
Contributor

flip111 commented Jun 3, 2018

Symfony version(s) affected: master (of today)

Description
mkdir failure

How to reproduce
./phpunit src/Symfony/Component/Finder/

Possible Solution
no

Additional context

Testing src/Symfony/Component/Finder/
..............................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  63 / 168 ( 37%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.........EEEEEEEEEEEEE....... 126 / 168 ( 75%)
.................................EEEEEEEEE                      168 / 168 (100%)

Time: 43.95 seconds, Memory: 6.00MB

There were 89 errors:

1) Symfony\Component\Finder\Tests\FinderTest
mkdir(): File exists

/proj/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php:57

Truncated many more lines all caused by failure at line 57 of RealIteratorTestCase.php

PHP 7.2.5
OS: ubuntu 16.04

@nicolas-grekas
Copy link
Member

Hello, I don't reproduce this issue, tests pass on my laptop. Can you debug why it fails and submit a PR if you find something to fix?

@flip111
Copy link
Contributor Author

flip111 commented Jun 5, 2018

I don't know how to debug this, please advise.

@flip111
Copy link
Contributor Author

flip111 commented Jun 5, 2018

I can't reproduce this anymore, i will reopen and try to look around in the fileystem at the time this error occurs.

@flip111 flip111 closed this as completed Jun 5, 2018
@flip111
Copy link
Contributor Author

flip111 commented Jun 5, 2018

Oh actually i can reproduce this .. i had another project with Finder that doesn't clean up. I'll try to find the problem and make Finder a bit more resilient.

@flip111
Copy link
Contributor Author

flip111 commented Jun 6, 2018

About the FinderTest .. all paths are hardcoded, should they stay like that or can the right paths be searched? For example ..

$this->assertIterator($this->toAbsolute(array(
'.git',
'foo',
'foo/bar.tmp',
'test.php',
'test.py',
'toto',
'toto/.git',
'.bar',
'.foo',
'.foo/.bar',
'.foo/bar',
'foo bar',
'qux',
'qux/baz_100_1.py',
'qux/baz_1_2.py',
'qux_0_1.php',
'qux_1000_1.php',
'qux_1002_0.php',
'qux_10_2.php',
'qux_12_0.php',
'qux_2_0.php',
)), $finder->in(self::$tmpDir)->getIterator());
the thing is that by changing the fixture all the test cases need to be updated. It's tedious

nicolas-grekas added a commit that referenced this issue Jun 19, 2018
This PR was submitted for the master branch but it was squashed and merged into the 2.8 branch instead (closes #27508).

Discussion
----------

[Finder] Update RealIteratorTestCase

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27480
| License       | MIT
| Doc PR        | n/a

Makes the entire test directory empty instead of trying to delete particular files and directories. The old method failed when trying to remove a directory which was not empty.

Commits
-------

7d0ebd4 [Finder] Update RealIteratorTestCase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants