Issues

ZF-12180: Zend_Search_Lucene tests fail on second run

Issue Type: Bug Created: 2012-04-26T19:44:28.000+0000 Last Updated: 2012-05-17T21:29:04.000+0000 Status: Resolved Fix version(s): - 1.12.0 (27/Aug/12)

Reporter: Martin Hujer (mhujer) Assignee: Rob Allen (rob) Tags: - Zend_Search_Lucene

Related issues: Attachments: - LuceneTest.php.patch

Description

Tests are OK during the first run, but there is probably an issue with cleaning up temporary files, so it does not work properly on second run.

PHP 5.3.8, Windows 7 64bit, PHPUnit 3.4.15

<pre class="highlight">
There were 9 errors:

1) Zend_Search_Lucene_LuceneTest::testCreate
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:67

2) Zend_Search_Lucene_LuceneTest::testAddDocument
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:284

3) Zend_Search_Lucene_LuceneTest::testOptimize
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:329

4) Zend_Search_Lucene_LuceneTest::testTermsStreamInterfaceSkipToTermsRetrievingZeroTermsCase
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:449

5) Zend_Search_Lucene_LuceneTest::testTermsStreamInterfaceSkipToTermsRetrievingOneTermsCase
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:474

6) Zend_Search_Lucene_LuceneTest::testTermsStreamInterfaceSkipToTermsRetrievingTwoTermsCase
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:499

7) Zend_Search_Lucene_LuceneTest::testTermsStreamInterfaceSkipToMatchedTerm
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:527

8) Zend_Search_Lucene_LuceneTest::testIsDeletedWithoutExplicitCommit
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\LuceneTest.php:561

9) Zend_Search_Lucene_DocumentTest::testHtmlInlineTagsIndexing
Zend_Search_Lucene_Exception: File 'I:\xampp\zf\tests\Zend\Search\Lucene/_index/_files/segments_2' is not readable.

I:\xampp\zf\library\Zend\Search\Lucene\Storage\File\Filesystem.php:56
I:\xampp\zf\library\Zend\Search\Lucene\Storage\Directory\Filesystem.php:359
I:\xampp\zf\library\Zend\Search\Lucene.php:551
I:\xampp\zf\library\Zend\Search\Lucene.php:211
I:\xampp\zf\tests\Zend\Search\Lucene\DocumentTest.php:202

Comments

Posted by Tomáš Fejfar (tomas.fejfar@gmail.com) on 2012-05-10T21:02:32.000+0000

Problem is that the directory is not cleared BEFORE each test. Fixed by adding setUp() method where the directory is cleared. Clear directory calls inside tests were removed.

Posted by Rob Allen (rob) on 2012-05-17T21:29:04.000+0000

Fixed in r24811.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts