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

running a test file is slow when there are failing tests #1007

Closed
nicoder opened this issue Sep 23, 2013 · 8 comments
Closed

running a test file is slow when there are failing tests #1007

nicoder opened this issue Sep 23, 2013 · 8 comments

Comments

@nicoder
Copy link

nicoder commented Sep 23, 2013

When I run a single test with phpunit myTest.php:

  • it is fast if there are no errors
  • it seems like it takes 10 seconds when there is an error/failure

I tracked it down to the PHPUnit_Util_GlobalState#phpunitFiles method, which takes seven seconds to run on my windows 7 box (php 5.4.19, phpunit 3.7.24).

I wonder if this commit is not the culprit :
8941060

but then I could not test by juste replacing the file with the previous commit because for example the phpunit_autoload function does not exist any more.

As a workaround I will cache the file names in a file on disk.

Someone seemed to have the same issue on stackoverflow :
http://stackoverflow.com/questions/17124190/phpunit-runs-very-slow-when-the-assertion-fails

@andig
Copy link
Contributor

andig commented Dec 3, 2013

Same problem with 3.7.27 on Win7 Php 5.4

@david-riehl
Copy link

i have the same problem with 3.7.28 on Win 7 starter with PHP 5.4.14 (easyphp dev server)

@randyli
Copy link

randyli commented Dec 14, 2013

Same problem with 3.7.28 on linux with php 5.4.19

@sebastianbergmann
Copy link
Owner

@whatthejeff @edorian Could you have a look at the branch, please? The filtering of stacktraces no longer relies on blacklisted files but rather on blacklisted class names. For this to work properly, though, the line/file information needs to be shifted from frame n to frame n+1 (caller vs. callee). Currently 3 tests of PHPUnit's own test suite fail on my machine after this patch. Will investigate when I have more time.

@whatthejeff
Copy link
Contributor

@sebastianbergmann I'm pretty swamped for the next couple of weeks. I'll try to find some time, though.

@sebastianbergmann
Copy link
Owner

@whatthejeff No worries.

@sebastianbergmann
Copy link
Owner

Fixed in 3f486c8

@CJDennis
Copy link

I have the same issue on Windows XP, PHPUnit 4.3.4, PHP 5.4.24

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

No branches or pull requests

7 participants