Forum: Ferret Ferret failing to rebuild_index - occasionally unable to del

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Richard L. (Guest)
on 2006-04-29 02:33
I'm switching all my fulltext searching over to ferret using the
acts_as_ferret plugin on windows (for development, will be deployed on
linux).

In my tests I have a setup method as follows to ensure the index is
reset for each test:

def setup
  Item.rebuild_index
end

This works fine for the initial few tests but then suddenly fails for
the last few tests when it seems to be failing to delete a file.

Loaded suite E:/rails/thatsprogress/test/unit/item_test
Started
........EEEE
Finished in 8.922 seconds.

  1) Error:
test_search_for_count(ItemTest):
Errno::EACCES: Permission denied -
E:/rails/thatsprogress/config/../index/test/Item/_j.cfs
....

Full trace included later.

It consistantly does it at this point, and looks like something is
stopping _j.cfs from being deleted.

Any ideas on what's going on and how to stop it?

Thanks in advance.



Full trace is as follows:

Loaded suite E:/rails/thatsprogress/test/unit/item_test
Started
........EEEE
Finished in 8.922 seconds.

  1) Error:
test_search_for_count(ItemTest):
Errno::EACCES: Permission denied -
E:/rails/thatsprogress/config/../index/test/Item/_j.cfs

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:105:in
`delete'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:105:in
`refresh'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:104:in
`each'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:123:in
`each'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:123:in
`each'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:104:in
`refresh'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:101:in
`synchronize'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:101:in
`refresh'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:74:in
`new'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:68:in
`synchronize'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/store/fs_store.rb:68:in
`new'

D:/programming/ruby/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/index/index.rb:133:in
`initialize'

E:/rails/thatsprogress/config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:223:in
`new'

E:/rails/thatsprogress/config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:223:in
`rebuild_index'
    E:/rails/thatsprogress/test/unit/item_test.rb:15:in
`setup_without_fixtures'

E:/rails/thatsprogress/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:554:in
`setup'

E:/rails/thatsprogress/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:552:in
`setup'



--
R.Livsey
http://livsey.org
Kasper W. (Guest)
on 2006-05-02 12:33
I have looked at this problem recently but didn't solve it entirely. I
suspect that windows is not releasing the files soon enough for the next
test to work on them.

This post might offer some insight
http://www.talkaboutprogramming.com/group/comp.lan...

Kasper

> Loaded suite E:/rails/thatsprogress/test/unit/item_test
> Started
> ........EEEE
> Finished in 8.922 seconds.
>
>   1) Error:
> test_search_for_count(ItemTest):
> Errno::EACCES: Permission denied -
> E:/rails/thatsprogress/config/../index/test/Item/_j.cfs
> ....
akb (Guest)
on 2006-05-03 02:18
Most of the tests also fail on Windows with a similar error on the demo
provided in svn.  I tried adding some sleeps but that doesn't make a
difference.


Kasper W. wrote:
> I have looked at this problem recently but didn't solve it entirely. I
> suspect that windows is not releasing the files soon enough for the next
> test to work on them.
>
> This post might offer some insight
> http://www.talkaboutprogramming.com/group/comp.lan...
>
> Kasper
>
>> Loaded suite E:/rails/thatsprogress/test/unit/item_test
>> Started
>> ........EEEE
>> Finished in 8.922 seconds.
>>
>>   1) Error:
>> test_search_for_count(ItemTest):
>> Errno::EACCES: Permission denied -
>> E:/rails/thatsprogress/config/../index/test/Item/_j.cfs
>> ....
Kasper W. (Guest)
on 2006-05-05 05:24
I think windows is locking the file for deletion until the test process
ends - or something similar.

akb wrote:
> Most of the tests also fail on Windows with a similar error on the demo
> provided in svn.  I tried adding some sleeps but that doesn't make a
> difference.
>
Kasper W. (Guest)
on 2006-05-10 21:19
This problem seems to have been solved with ferret 0.9.2

Kasper W. wrote:
> I think windows is locking the file for deletion until the test process
> ends - or something similar.
>
> akb wrote:
>> Most of the tests also fail on Windows with a similar error on the demo
>> provided in svn.  I tried adding some sleeps but that doesn't make a
>> difference.
>>
akb (Guest)
on 2006-05-14 22:01
Unfortunately I still see this problem with both 0.9.2 and 0.9.3.

a

Kasper W. wrote:
> This problem seems to have been solved with ferret 0.9.2
>
> Kasper W. wrote:
>> I think windows is locking the file for deletion until the test process
>> ends - or something similar.
>>
>> akb wrote:
>>> Most of the tests also fail on Windows with a similar error on the demo
>>> provided in svn.  I tried adding some sleeps but that doesn't make a
>>> difference.
>>>
This topic is locked and can not be replied to.