Bug #64714 [Com]: 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
Comment by: mattficken@php.net
Reported by: mattficken@php.net
Summary: ext/standard/tests/file/bug24482.phpt finds too many
files if run too fast
Status: Open
Type: Bug
Package: Testing related
Operating System: Windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Bug affects 5.3, 5.4, 5.5 on Windows.
Attached patch fixes it on Windows and doesn't break on Linux.
Previous Comments:
------------------------------------------------------------------------
[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)