Bug #3832
PHP Unit Testing randomly failes with "files does not exist" (PHP 5.3.0 final version fails ,PHP 5.30 RC2 works)
| Status: | Closed | Start: | 2009-07-04 | |
| Priority: | Must have | Due date: | ||
| Assigned to: | Karsten Dambekalns | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
Description
the unit test (run all tests ) fails with randomly "file not found errors" .The exception is thrown in the class Packages/Global/PHPUnit/Resources/PHP/PHPUnit/Util/Filter.php .
This seems to be a bug which is related to "some kind of file caching".
The function "addFileToFilter" which is defined in "Filter.php" is responsable for the error.
public static function addFileToFilter($filename, $group = 'DEFAULT')
{
if (file_exists($filename)) {
//echo "<br>file :".$filename."</br>";
//echo "<br>realpathfile :".realpath($filename)."</br>";
$filename = realpath($filename);
if (!isset(self::$blacklistedFiles[$group])) {
self::$blacklistedFiles[$group] = array($filename);
}
else if (!in_array($filename, self::$blacklistedFiles[$group])) {
self::$blacklistedFiles[$group][] = $filename;
}
} else {
# debug output
echo "<br>file :".$filename."</br>";
echo "<br>realpathfile :".realpath($filename)."</br>";
throw new RuntimeException($filename . ' does not exist');
}
}
I've tested this with php 5.3.0 (final) and it fails ,with php 5.3.0RC2 it works (!).
The compile time settings,the gnu toolchain,the configure command used and the build
enviroment are absolut identical for both php versions.
History
2009-07-06 14:50 - Robert Lemke
- Priority changed from Must have to -- undefined --
- Target version changed from 1.0.0 alpha 2 to 1.0
2009-07-09 17:54 - Karsten Dambekalns
- Project changed from FLOW3 to PHPUnit
- Category deleted (
Validation) - Target version deleted (
1.0)
2009-07-09 17:57 - Karsten Dambekalns
- Status changed from New to Needs Feedback
- Assigned to set to Karsten Dambekalns
Does the file given as $filename exist and file_exists() wrecks havoc, or is the input not correct in the first place?
2009-07-14 12:03 - Daniel H.
Sorry for the late reply.The file stored in the variable $filename does physically exist.The function thats "redefines the chaos" is
file_exists().Even if i use "clearstatecache(void)" in front of every file_exists function call it doesn't work.
I've debugged the php source code (TSRM/tsrm_virtual_cwd.c) where "virtual_stat" is defined which is called from
ext/standard/filefunc.c where the "stat" function is defined.The PHPAPI php_stat(..) is used by the php function file_exists().
After doing a lot of sourcecode debugging regarding the php source i came to the conclusion that it's not a php bug.
2009-09-30 17:54 - Karsten Dambekalns
Hi, has that ever happened again? I did not see this bug. Ever...