|
|
|
Assigning to Fabien Marty, since he was the last one to make changes to Zend_Cache_Backend.
Note that I have tried running the tests against revision 1399 and the current revision, 1406, and I see no failures. I have tried on Windows XP using PHP 5.1.6 and PHPUnit 3.0.0beta2. maybe there is something wrong with the "hardened-php / Suhosin-Patch" :
[...] More investigations are needed but I think the bug is not critical because it is related to a specific php configuration. Right now, Zend Framework does not support hardened-php or the Suhosin Patch. It is not part of our required testing configuration.
It's a good idea though to make sure ZF works in this environment. I'll create a separate development task to document the required environment for support and testing. Also happens with plain PHP:
$ /home/sebastian/slash/opt/php-cli/bin/phpunit -d include_path=.:$(pwd)/library:$(pwd)/tests:/home/sebastian/slash/opt/php-cli/lib/php AllTests tests/AllTests.php ......................................... Time: 00:00 There were 2 errors: 1) testCleanModeMatchingTags(Zend_Cache_FileBackendTest) 2) testCleanModeMatchingTags2(Zend_Cache_FileBackendTest) 1) testSaveCorrectCallWithHashedDirectoryStructure(Zend_Cache_FileBackendTest) 2) testCleanModeAllWithHashedDirectoryStructure(Zend_Cache_FileBackendTest) 3) testSaveCorrectCall(Zend_Cache_FileBackendTest) 4) testSaveWithNullLifeTime(Zend_Cache_FileBackendTest) 5) testRemoveCorrectCall(Zend_Cache_FileBackendTest) 6) testGetWithAnExistingCacheIdAndUTFCharacters(Zend_Cache_FileBackendTest) 7) testCleanModeAll(Zend_Cache_FileBackendTest) 8) testCleanModeOld(Zend_Cache_FileBackendTest) 9) testCleanModeNotMatchingTags(Zend_Cache_FileBackendTest) 10) testCleanModeNotMatchingTags2(Zend_Cache_FileBackendTest) 11) testCleanModeNotMatchingTags3(Zend_Cache_FileBackendTest) FAILURES! $ /home/sebastian/slash/opt/php-cli/bin/phpunit --version $ /home/sebastian/slash/opt/php-cli/bin/php -v phpinfo() System => Linux h939937 2.6.15-26-686 #1 SMP PREEMPT Fri Sep 8 20:16:40 UTC 2006 i686 This program makes use of the Zend Scripting Language Engine: this evening, a problem was corrected in SVN (about unit tests)
is it better now ? I still have not been able to reproduce the failures reported by Sebastian Nohn. I am using PHP 5.1.6 and PHPUnit 3.0.0.
Sebastian, can you please re-test with the latest Zend Framework code from subversion or the nightly snapshot download, and tell us if you are still experiencing failures? Clean checkout:
[....] Vanilla Ubuntu 6.06 $ phpunit -d include_path=.:$(pwd)/library:$(pwd)/tests:/opt/php/lib/php AllTests tests/AllTests.php PHPUnit 3.0.0 by Sebastian Bergmann. ......................................... Call Stack: F.................... Time: 00:09 There were 2 errors: 1) testIterator(Zend_ConfigTest) 2) testBoolean(Zend_JsonTest) 1) testCleanModeAllWithHashedDirectoryStructure(Zend_Cache_FileBackendTest) 2) testCleanModeAll(Zend_Cache_FileBackendTest) 3) testCleanModeOld(Zend_Cache_FileBackendTest) 4) testCleanModeNotMatchingTags(Zend_Cache_FileBackendTest) 5) testCleanModeNotMatchingTags2(Zend_Cache_FileBackendTest) 6) testCleanModeNotMatchingTags3(Zend_Cache_FileBackendTest) 7) testInteger(Zend_JsonTest) 8) testFloat(Zend_JsonTest) 9) testString(Zend_JsonTest) 10) testString2(Zend_JsonTest) 11) testString3(Zend_JsonTest) /home/sebastian/Work/ZendFramework/tests/Zend/JsonTest.php:119 12) testString4(Zend_JsonTest) 13) testString5(Zend_JsonTest) 14) testObject(Zend_JsonTest) 15) testEncodeReleaseNumber(Zend_JsonTest) 16) testSetArrayProperty(Zend_ViewTest) FAILURES! Thanks for your diligent work Sebastian. I would like to get to the bottom of these failures and solve this for you and for general quality improvement in Zend Framework.
I don't typically run the tests on Linux, I do my development and testing on Windows XP (although I have many years of experience using UNIX and Linux and I'm comfortable in that environment too). I do not see the failures you describe. So I'll set up a test environment on my Linux box and see if I can reproduce the errors and failures you're seeing. Please understand why I'm focused on being able to reproduce these failures. It's pretty important to be able to observe the failures myself, because otherwise I won't know if any change I make fixed the failure! Can verify behaviour with ZF 0.6.0 and latest 5.2.1RC2-dev on Ubuntu 6.06
Some of the tests fail due to permission problems when different users run the unit tests on the same machine. Therefore I suggest to either remove the cache directory after running the tests or even better - to avoid problems caused by concurrent unit test runs - make the individual "/tmp" configurable via TestConfiguration.php.
The other problem is in the implementation of Zend_Cache_Backend_File::_clean(): $glob = @glob($dir . 'cache_*'); Of course there can be dozens of other files name cache_* in /tmp. I don't exactly know what the rest of this function does, but the result is false, resulting in failing unit tests and for sure also making problems in real applications relying on the return value of this function. However, Zend_Cache should only touch files it created itself. It seems Zend_Cache tries to purge ALL files name cache_*, therefore I am setting the severity to critical. Okay, thank you for this clarification, Sebastian. It was not clear from your earlier descriptions that the issue was permission-related, or that more than one users was running unit tests on the same machine.
You are right that the tests should not use common system directories by default with generically-named files. As a temporary workaround, you can specify a cache directory for the unit tests with environment variables TMP or TEMP. This will permit each user to run the unit tests with distinct cache directories. I'm changing the summary of this bug and here is a proposal for a more permanent solution:
it should be ok now => the temp directory is now in the test tree
it's ok on my linux box tests are needed (particulary on windows) ! Current set of (Cache) Unit Tests pass with rev 2724.
The work that was done for this fix was actually released in ZF 0.7, so I'm updating the fix version.
|
||||||||||||||||||||||||||||||||||||||||||||||
Linux h939937 2.6.15-26-686 #1 SMP PREEMPT Fri Sep 8 20:16:40 UTC 2006 i686 GNU/Linux