Bug Report #3268

KohanaCacheTest RecursiveDirectoryIterator fails of directory operations

Added by Chris Miller almost 4 years ago. Updated about 3 years ago.

Status:ClosedStart date:09/22/2010
Priority:NormalDue date:
Assignee:Sam de Freyssinet% Done:

0%

Category:-
Target version:Kohana v3.x - v3.2.0
Resolution:worksforme Points:

Description

Kohana 3.0.7.1
PHPUnit 3.4.15
Xdebug 2.1

When running the UnitTest Module WebUI, the Cache Module tests fail as follows :

3 Errors [hide]

1. KohanaCacheTest::testInstance RecursiveDirectoryIterator::__construct(/home/phpunit/kohana/application/cache/.kohana_cache) [<a href='recursivedirectoryiterator.--construct'>recursivedirectoryiterator.--construct</a>]: failed to open dir: No such file or directory
2. KohanaCacheTest::testGet RecursiveDirectoryIterator::__construct(/home/phpunit/kohana/application/cache/.kohana_cache) [<a href='recursivedirectoryiterator.--construct'>recursivedirectoryiterator.--construct</a>]: failed to open dir: No such file or directory
3. KohanaCacheTest::testSet RecursiveDirectoryIterator::__construct(/home/phpunit/kohana/application/cache/.kohana_cache) [<a href='recursivedirectoryiterator.--construct'>recursivedirectoryiterator.--construct</a>]: failed to open dir: No such file or directory

If the APPDIR/cache/.kohana_cache directory is created and tests are run again, a non-descriptive mkdir() error is displayed, and all the contents of the APPDIR/cache directory (aka parent of .kohana_cache) are deleted. Changing the Kohana cache directory to APPDIR/cache causes much of APPDIR/* to be deleted, requiring a reinstall of Kohana.

History

#1 Updated by Isaiah DeRose-Wilson almost 4 years ago

What php version are you using? This sounds like the same problem as #3063 and #3021

#2 Updated by Woody Gilk almost 4 years ago

  • Target version changed from v3.0.8 to v3.0.9

#3 Updated by Chris Miller almost 4 years ago

Isaiah DeRose-Wilson wrote:

What php version are you using? This sounds like the same problem as #3063 and #3021

CentOS 5.5
PHP 5.2.13 from IUS project http://iuscommunity.org/

I just upgraded to 5.2.14 but the problem remains.

It looks like it could be related to 3021. If you have a patch or suggested change, I can give it a try.

#4 Updated by Chris Miller almost 4 years ago

Just an update. After upgrading to PHP 5.2.14, and manually creating APPDIR/cache/.kohana_cache, I now get an splfileinfo error rather than a mkdir error when using the WebUI :

1. KohanaCacheTest::testInstance SplFileInfo::openFile(/43/43850a87bd5a8ab164e1ed9a7dd52b9001b320c0.txt) [<a href='splfileinfo.openfile'>splfileinfo.openfile</a>]: failed to open stream: Permission denied
2. KohanaCacheTest::testGet SplFileInfo::openFile(/43/43850a87bd5a8ab164e1ed9a7dd52b9001b320c0.txt) [<a href='splfileinfo.openfile'>splfileinfo.openfile</a>]: failed to open stream: Permission denied
3. KohanaCacheTest::testSet SplFileInfo::openFile(/43/43850a87bd5a8ab164e1ed9a7dd52b9001b320c0.txt) [<a href='splfileinfo.openfile'>splfileinfo.openfile</a>]: failed to open stream: Permission denied

If I run the test at the command line (without creating .kohana_cache), I get additional information referencing the source of the failure :

1) KohanaCacheTest::testInstance
RecursiveDirectoryIterator::__construct(/home/phpunit/kohana/application/cache/.kohana_cache): failed to open dir: No such file or directory

/home/phpunit/kohana/modules/cache/classes/kohana/cache/file.php:84
/home/phpunit/kohana/modules/cache/classes/kohana/cache.php:134

However, if I create .kohana_cache, the the tests complete successfully :

  1. phpunit --bootstrap=../www/index.php modules/unittest/tests.php

PHPUnit 3.4.15 by Sebastian Bergmann.

...

Time: 5 seconds, Memory: 6.00Mb

OK (3 tests, 13 assertions)

And of course .kohana_cache still gets deleted upon test completion, not sure if that's normal or not.

#5 Updated by Matt Button almost 4 years ago

  • Project changed from Kohana v3.x to Cache
  • Category deleted (Modules:Cache)

#6 Updated by Matt Button almost 4 years ago

The problem behind the error is that the cache tests aren't creating the cache dir in setUp. Other tests purge the cache dir in their setUp/tearDown methods, which is why the folder disappears after tests are run.

#7 Updated by Sam de Freyssinet almost 4 years ago

  • Status changed from New to Assigned

#8 Updated by Woody Gilk over 3 years ago

  • Target version changed from v3.0.9 to v3.0.10

#9 Updated by Jeremy Bush over 3 years ago

  • Target version changed from v3.0.10 to v3.0.11

#10 Updated by Jeremy Bush over 3 years ago

  • Target version changed from v3.0.11 to v3.0.12

#11 Updated by Matt Button about 3 years ago

  • Status changed from Assigned to Closed
  • Target version changed from v3.0.12 to v3.2.0
  • Resolution set to worksforme

Closing as this isn't apparent in the cli tests and the webui is deprecated

Also available in: Atom PDF