Bug #64714 [Opn->Csd]: ext/standard/tests/file/bug24482.phpt finds too many files if run too fast
Edit report at https://bugs.php.net/bug.php?id=64714&edit=1
ID: 64714
Updated by: ab@php.net
Reported by: mattficken@php.net
Summary: ext/standard/tests/file/bug24482.phpt finds too many
files if run too fast
-Status: Open
+Status: Closed
Type: Bug
Package: Testing related
Operating System: Windows
PHP Version: Irrelevant
-Assigned To:
+Assigned To: ab
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Fixed in bf5506f511e66a2b827988d611ccda4d75abc44e
Previous Comments:
------------------------------------------------------------------------
[2013-04-25 18:48:27] mattficken@php.net
Bug affects 5.3, 5.4, 5.5 on Windows.
Attached patch fixes it on Windows and doesn't break on Linux.
------------------------------------------------------------------------
[2013-04-25 18:47:31] mattficken@php.net
The following patch has been added/updated:
Patch Name: bug24482.patch.txt
Revision: 1366915651
URL: https://bugs.php.net/patch-display.php?bug=64714&patch=bug24482.patch.txt&revision=1366915651
------------------------------------------------------------------------
[2013-04-25 18:32:05] mattficken@php.net
Description:
------------
ext/standard/tests/file/bug24482.phpt, run fast enough with other tests, on 4+ cpu core machines may
get a different count of the files in the ext/standard/tests/file directory from glob() and
opendir().
This is not a stat cache problem. Its just that other PHPT tests create files in
ext/standard/tests/file directory and, though they clean them up, on very fast Windows servers,
sometimes the deletion is committed to the file system (by Windows) during the time between the
glob() and opendir() calls.
This isn't really a PHP problem, but rather an OS behavior/side-effect of performance
optimizations in the OS/file-system.
The simple solution is to change the directory the test checks to ext/standard/tests. PHPT tests
don't create test files there at all, so the count of files/directories there won't change
during a test run.
Test script:
---------------
See ext/standard/tests/file/bug24482.phpt
Expected result:
----------------
Pass
Actual result:
--------------
Fail (2 different counts)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64714&edit=1
Thread (4 messages)