phpunit causes Windows Explorer to lag on Windows 7

1

I am currently creating some automated testing suites for phpunit. This means I may run phpunit several times in a day. Sometimes, after I've run it, Windows Explorer just starts lagging.

This expresses itself in several ways: the context menu takes several seconds to come up when right-clicking in Windows Explorer, deleting folders takes a very long time (and sometimes stalls completely), renaming files/folders takes a very long time, my icon overlays disappear, etc. The only way to fix the problem is to reboot the computer (killing and rerunning explorer.exe doesn't help).

The problem is intermittent. Sometimes I can run phpunit dozens of times and nothing happens. Then I run it again on the same test and...bingo. I've experienced this on two separate computers, both running Windows 7-64 bit Home Edition. It never happens if I don't run phpunit.

Is there any way I can stop phpunit from doing this? Or at least fix it without having to do a full reboot?

Swiftheart

Posted 2015-01-10T02:06:06.083

Reputation: 193

Have you tried fixing this by logging off and then back on again? If this works then you know that the problem is something running in your profile and not a system wide issue. Also, try disabling indexing to see if it goes away. – krowe – 2015-01-10T06:34:24.363

Answers

0

One way to fix this would be to move phpUnit down the tool chain. Instead of running it for every small change, just run it once a week or so. Another option, which works along the same lines as well, is to create a pre-production webserver. If you work in a team environment then your team probably already has this (for assembling the pull request and for testing). This is generally the best place to run your unit tests from. Even if you are working solo it might be a good idea to start using a setup like this because it has many advantages besides making unit testing less obtrusive.

krowe

Posted 2015-01-10T02:06:06.083

Reputation: 5 031

I'm running phpunit often because I'm testing the tests I'm writing, not the code itself. At any rate, while "don't run phpunit" is technically a solution to "phpunit is causing problems," it's really not the answer I'm looking for. – Swiftheart – 2015-01-10T06:19:48.867

That isn't exactly what I'm saying. The main fix I'm suggesting is to move it to a system which you aren't actively using (probably a Linux box which doesn't have Explorer anyway). If you wanted to, you could merge your project often and test often. – krowe – 2015-01-10T06:29:30.083